AV1-codec-support.patch 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Sun, 16 Dec 2018 15:24:19 +0100
  3. Subject: AV1 codec support
  4. libaom build fixes (requires -fPIC)
  5. Report AV1 as playable on Android
  6. ---
  7. third_party/libaom/BUILD.gn | 6 ++++--
  8. third_party/libaom/libaom_srcs.gni | 5 +++++
  9. .../config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
  10. .../config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
  11. .../source/config/linux/arm-neon/config/aom_config.asm | 2 +-
  12. .../libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
  13. .../libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
  14. .../libaom/source/config/linux/arm/config/aom_config.h | 2 +-
  15. .../libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
  16. .../libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
  17. .../source/config/linux/generic/config/aom_config.asm | 2 +-
  18. .../libaom/source/config/linux/generic/config/aom_config.h | 2 +-
  19. .../libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
  20. .../libaom/source/config/linux/x64/config/aom_config.h | 2 +-
  21. 14 files changed, 21 insertions(+), 14 deletions(-)
  22. diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
  23. --- a/third_party/libaom/BUILD.gn
  24. +++ b/third_party/libaom/BUILD.gn
  25. @@ -81,7 +81,7 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
  26. sources += aom_dsp_encoder_asm_sse2_x86_64
  27. sources += aom_dsp_encoder_asm_ssse3_x86_64
  28. }
  29. - defines = [ "CHROMIUM" ]
  30. + defines = [ "CHROMIUM", "PIC" ]
  31. include_dirs = libaom_include_dirs
  32. }
  33. @@ -193,7 +193,7 @@ if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
  34. configs += [ "//build/config/compiler:no_chromium_code" ]
  35. if (current_cpu == "arm") {
  36. configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
  37. - cflags = [ "-mfpu=neon" ]
  38. + cflags = [ "-mfpu=neon", "-fPIC" ]
  39. }
  40. configs += [ ":libaom_config" ]
  41. @@ -255,6 +255,8 @@ static_library("libaom") {
  42. if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
  43. cpu_arch_full == "arm-neon-cpu-detect") {
  44. deps += [ ":libaom_intrinsics_neon" ]
  45. + # will detect CPU
  46. + sources += aom_ports_arm_sources
  47. }
  48. if (is_android) {
  49. deps += [ "//third_party/android_ndk:cpu_features" ]
  50. diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
  51. --- a/third_party/libaom/libaom_srcs.gni
  52. +++ b/third_party/libaom/libaom_srcs.gni
  53. @@ -652,6 +652,11 @@ aom_rc_interface_sources = [
  54. "//third_party/libaom/source/libaom/test/yuv_video_source.h",
  55. ]
  56. +aom_ports_arm_sources = [
  57. + "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
  58. + "//third_party/libaom/source/libaom/aom_ports/arm.h",
  59. + ]
  60. +
  61. aom_rtcd_sources = [
  62. "//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
  63. "//third_party/libaom/source/libaom/aom_scale/aom_scale_rtcd.c",
  64. diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
  65. --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
  66. +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
  67. @@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  68. CONFIG_OPTICAL_FLOW_API equ 0
  69. CONFIG_OS_SUPPORT equ 1
  70. CONFIG_PARTITION_SEARCH_ORDER equ 0
  71. -CONFIG_PIC equ 0
  72. +CONFIG_PIC equ 1
  73. CONFIG_RATECTRL_LOG equ 0
  74. CONFIG_RD_COMMAND equ 0
  75. CONFIG_RD_DEBUG equ 0
  76. diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
  77. --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
  78. +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
  79. @@ -52,7 +52,7 @@
  80. #define CONFIG_OPTICAL_FLOW_API 0
  81. #define CONFIG_OS_SUPPORT 1
  82. #define CONFIG_PARTITION_SEARCH_ORDER 0
  83. -#define CONFIG_PIC 0
  84. +#define CONFIG_PIC 1
  85. #define CONFIG_RATECTRL_LOG 0
  86. #define CONFIG_RD_COMMAND 0
  87. #define CONFIG_RD_DEBUG 0
  88. diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
  89. --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
  90. +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
  91. @@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  92. CONFIG_OPTICAL_FLOW_API equ 0
  93. CONFIG_OS_SUPPORT equ 1
  94. CONFIG_PARTITION_SEARCH_ORDER equ 0
  95. -CONFIG_PIC equ 0
  96. +CONFIG_PIC equ 1
  97. CONFIG_RATECTRL_LOG equ 0
  98. CONFIG_RD_COMMAND equ 0
  99. CONFIG_RD_DEBUG equ 0
  100. diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
  101. --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
  102. +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
  103. @@ -52,7 +52,7 @@
  104. #define CONFIG_OPTICAL_FLOW_API 0
  105. #define CONFIG_OS_SUPPORT 1
  106. #define CONFIG_PARTITION_SEARCH_ORDER 0
  107. -#define CONFIG_PIC 0
  108. +#define CONFIG_PIC 1
  109. #define CONFIG_RATECTRL_LOG 0
  110. #define CONFIG_RD_COMMAND 0
  111. #define CONFIG_RD_DEBUG 0
  112. diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
  113. --- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
  114. +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
  115. @@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  116. CONFIG_OPTICAL_FLOW_API equ 0
  117. CONFIG_OS_SUPPORT equ 1
  118. CONFIG_PARTITION_SEARCH_ORDER equ 0
  119. -CONFIG_PIC equ 0
  120. +CONFIG_PIC equ 1
  121. CONFIG_RATECTRL_LOG equ 0
  122. CONFIG_RD_COMMAND equ 0
  123. CONFIG_RD_DEBUG equ 0
  124. diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
  125. --- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
  126. +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
  127. @@ -52,7 +52,7 @@
  128. #define CONFIG_OPTICAL_FLOW_API 0
  129. #define CONFIG_OS_SUPPORT 1
  130. #define CONFIG_PARTITION_SEARCH_ORDER 0
  131. -#define CONFIG_PIC 0
  132. +#define CONFIG_PIC 1
  133. #define CONFIG_RATECTRL_LOG 0
  134. #define CONFIG_RD_COMMAND 0
  135. #define CONFIG_RD_DEBUG 0
  136. diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
  137. --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
  138. +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
  139. @@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  140. CONFIG_OPTICAL_FLOW_API equ 0
  141. CONFIG_OS_SUPPORT equ 1
  142. CONFIG_PARTITION_SEARCH_ORDER equ 0
  143. -CONFIG_PIC equ 0
  144. +CONFIG_PIC equ 1
  145. CONFIG_RATECTRL_LOG equ 0
  146. CONFIG_RD_COMMAND equ 0
  147. CONFIG_RD_DEBUG equ 0
  148. diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
  149. --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
  150. +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
  151. @@ -52,7 +52,7 @@
  152. #define CONFIG_OPTICAL_FLOW_API 0
  153. #define CONFIG_OS_SUPPORT 1
  154. #define CONFIG_PARTITION_SEARCH_ORDER 0
  155. -#define CONFIG_PIC 0
  156. +#define CONFIG_PIC 1
  157. #define CONFIG_RATECTRL_LOG 0
  158. #define CONFIG_RD_COMMAND 0
  159. #define CONFIG_RD_DEBUG 0
  160. diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
  161. --- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
  162. +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
  163. @@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  164. CONFIG_OPTICAL_FLOW_API equ 0
  165. CONFIG_OS_SUPPORT equ 1
  166. CONFIG_PARTITION_SEARCH_ORDER equ 0
  167. -CONFIG_PIC equ 0
  168. +CONFIG_PIC equ 1
  169. CONFIG_RATECTRL_LOG equ 0
  170. CONFIG_RD_COMMAND equ 0
  171. CONFIG_RD_DEBUG equ 0
  172. diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
  173. --- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
  174. +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
  175. @@ -52,7 +52,7 @@
  176. #define CONFIG_OPTICAL_FLOW_API 0
  177. #define CONFIG_OS_SUPPORT 1
  178. #define CONFIG_PARTITION_SEARCH_ORDER 0
  179. -#define CONFIG_PIC 0
  180. +#define CONFIG_PIC 1
  181. #define CONFIG_RATECTRL_LOG 0
  182. #define CONFIG_RD_COMMAND 0
  183. #define CONFIG_RD_DEBUG 0
  184. diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
  185. --- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
  186. +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
  187. @@ -40,7 +40,7 @@
  188. %define CONFIG_OPTICAL_FLOW_API 0
  189. %define CONFIG_OS_SUPPORT 1
  190. %define CONFIG_PARTITION_SEARCH_ORDER 0
  191. -%define CONFIG_PIC 0
  192. +%define CONFIG_PIC 1
  193. %define CONFIG_RATECTRL_LOG 0
  194. %define CONFIG_RD_COMMAND 0
  195. %define CONFIG_RD_DEBUG 0
  196. diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
  197. --- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
  198. +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
  199. @@ -52,7 +52,7 @@
  200. #define CONFIG_OPTICAL_FLOW_API 0
  201. #define CONFIG_OS_SUPPORT 1
  202. #define CONFIG_PARTITION_SEARCH_ORDER 0
  203. -#define CONFIG_PIC 0
  204. +#define CONFIG_PIC 1
  205. #define CONFIG_RATECTRL_LOG 0
  206. #define CONFIG_RD_COMMAND 0
  207. #define CONFIG_RD_DEBUG 0
  208. --
  209. 2.25.1