bc7_common_encoder.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //=========================================================================
  2. // Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files(the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions :
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #include "common_def.h"
  23. #include "bcn_common_api.h"
  24. #ifdef USE_CMPMSC
  25. #include "bc7_cmpmsc.h"
  26. #endif
  27. #ifdef USE_MSC
  28. #include "./external/bc7_msc.h"
  29. #endif
  30. #ifdef USE_MSC16
  31. #include "./external/bc7_msc16.h"
  32. #endif
  33. #ifdef USE_MSC1
  34. #include "./external/bc7_msc1.h"
  35. #endif
  36. #ifdef USE_INT
  37. #include "./external/bc7_int.h"
  38. #endif
  39. #ifdef USE_RGBCX_RDO
  40. #include "./external/bc7_rgbcx_rdo.h"
  41. #endif
  42. #ifdef USE_VOLT
  43. #include "./external/bc7_volt.h"
  44. #endif
  45. #ifdef USE_ICBC
  46. #include "./external/bc7_icbc.h"
  47. #endif
  48. #ifdef USE_ARRIS
  49. #include "./external/bc7_arris.h"
  50. #endif
  51. static CGU_Vec4ui CompressBlockBC7_UNORM(CMP_IN CGU_Vec4f image_src[16], CMP_IN CGU_FLOAT fquality)
  52. {
  53. #ifdef USE_CMPMSC
  54. return CompressBlockBC7_CMPMSC(image_src, fquality);
  55. #endif
  56. #ifdef USE_INT
  57. return CompressBlockBC7_INT(image_src, fquality);
  58. #endif
  59. #ifdef USE_RGBCX_RDO
  60. return CompressBlockBC7_RGBCX(image_src, fquality);
  61. #endif
  62. #ifdef USE_VOLT
  63. return CompressBlockBC7_VOLT(image_src, fquality);
  64. #endif
  65. #ifdef USE_ICBC
  66. return CompressBlockBC7_ICBC(image_src, fquality);
  67. #endif
  68. #if defined(USE_MSC)
  69. CGU_Vec4ui res = {0, 0, 0, 0};
  70. return res;
  71. #endif
  72. #ifdef USE_ARRIS
  73. return CompressBlockBC7_ARRIS(image_src, fquality);
  74. #endif
  75. #ifndef USE_NEW_SINGLE_HEADER_INTERFACES
  76. CGU_Vec4ui cmp = {0,0,0,0};
  77. CMP_UNUSED(fquality);
  78. CMP_UNUSED(image_src);
  79. return cmp;
  80. #endif
  81. }