AV1-codec-support.patch 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. @@ -82,7 +82,7 @@ if (enable_libaom) {
  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. @@ -194,7 +194,7 @@ if (enable_libaom) {
  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. @@ -257,6 +257,8 @@ if (enable_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. @@ -642,6 +642,11 @@ aom_mem_sources = [
  54. aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/float.asm" ]
  55. +aom_ports_arm_sources = [
  56. + "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
  57. + "//third_party/libaom/source/libaom/aom_ports/arm.h",
  58. + ]
  59. +
  60. aom_rtcd_sources = [
  61. "//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
  62. "//third_party/libaom/source/libaom/aom_scale/aom_scale_rtcd.c",
  63. 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
  64. --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
  65. +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
  66. @@ -49,7 +49,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  67. CONFIG_OPTICAL_FLOW_API equ 0
  68. CONFIG_OS_SUPPORT equ 1
  69. CONFIG_PARTITION_SEARCH_ORDER equ 0
  70. -CONFIG_PIC equ 0
  71. +CONFIG_PIC equ 1
  72. CONFIG_RD_COMMAND equ 0
  73. CONFIG_RD_DEBUG equ 0
  74. CONFIG_REALTIME_ONLY equ 1
  75. 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
  76. --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
  77. +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
  78. @@ -51,7 +51,7 @@
  79. #define CONFIG_OPTICAL_FLOW_API 0
  80. #define CONFIG_OS_SUPPORT 1
  81. #define CONFIG_PARTITION_SEARCH_ORDER 0
  82. -#define CONFIG_PIC 0
  83. +#define CONFIG_PIC 1
  84. #define CONFIG_RD_COMMAND 0
  85. #define CONFIG_RD_DEBUG 0
  86. #define CONFIG_REALTIME_ONLY 1
  87. 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
  88. --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
  89. +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
  90. @@ -49,7 +49,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  91. CONFIG_OPTICAL_FLOW_API equ 0
  92. CONFIG_OS_SUPPORT equ 1
  93. CONFIG_PARTITION_SEARCH_ORDER equ 0
  94. -CONFIG_PIC equ 0
  95. +CONFIG_PIC equ 1
  96. CONFIG_RD_COMMAND equ 0
  97. CONFIG_RD_DEBUG equ 0
  98. CONFIG_REALTIME_ONLY equ 1
  99. 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
  100. --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
  101. +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
  102. @@ -51,7 +51,7 @@
  103. #define CONFIG_OPTICAL_FLOW_API 0
  104. #define CONFIG_OS_SUPPORT 1
  105. #define CONFIG_PARTITION_SEARCH_ORDER 0
  106. -#define CONFIG_PIC 0
  107. +#define CONFIG_PIC 1
  108. #define CONFIG_RD_COMMAND 0
  109. #define CONFIG_RD_DEBUG 0
  110. #define CONFIG_REALTIME_ONLY 1
  111. 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
  112. --- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
  113. +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
  114. @@ -49,7 +49,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  115. CONFIG_OPTICAL_FLOW_API equ 0
  116. CONFIG_OS_SUPPORT equ 1
  117. CONFIG_PARTITION_SEARCH_ORDER equ 0
  118. -CONFIG_PIC equ 0
  119. +CONFIG_PIC equ 1
  120. CONFIG_RD_COMMAND equ 0
  121. CONFIG_RD_DEBUG equ 0
  122. CONFIG_REALTIME_ONLY equ 1
  123. 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
  124. --- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
  125. +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
  126. @@ -51,7 +51,7 @@
  127. #define CONFIG_OPTICAL_FLOW_API 0
  128. #define CONFIG_OS_SUPPORT 1
  129. #define CONFIG_PARTITION_SEARCH_ORDER 0
  130. -#define CONFIG_PIC 0
  131. +#define CONFIG_PIC 1
  132. #define CONFIG_RD_COMMAND 0
  133. #define CONFIG_RD_DEBUG 0
  134. #define CONFIG_REALTIME_ONLY 1
  135. 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
  136. --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
  137. +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
  138. @@ -49,7 +49,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  139. CONFIG_OPTICAL_FLOW_API equ 0
  140. CONFIG_OS_SUPPORT equ 1
  141. CONFIG_PARTITION_SEARCH_ORDER equ 0
  142. -CONFIG_PIC equ 0
  143. +CONFIG_PIC equ 1
  144. CONFIG_RD_COMMAND equ 0
  145. CONFIG_RD_DEBUG equ 0
  146. CONFIG_REALTIME_ONLY equ 1
  147. 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
  148. --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
  149. +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
  150. @@ -51,7 +51,7 @@
  151. #define CONFIG_OPTICAL_FLOW_API 0
  152. #define CONFIG_OS_SUPPORT 1
  153. #define CONFIG_PARTITION_SEARCH_ORDER 0
  154. -#define CONFIG_PIC 0
  155. +#define CONFIG_PIC 1
  156. #define CONFIG_RD_COMMAND 0
  157. #define CONFIG_RD_DEBUG 0
  158. #define CONFIG_REALTIME_ONLY 1
  159. 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
  160. --- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
  161. +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
  162. @@ -49,7 +49,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  163. CONFIG_OPTICAL_FLOW_API equ 0
  164. CONFIG_OS_SUPPORT equ 1
  165. CONFIG_PARTITION_SEARCH_ORDER equ 0
  166. -CONFIG_PIC equ 0
  167. +CONFIG_PIC equ 1
  168. CONFIG_RD_COMMAND equ 0
  169. CONFIG_RD_DEBUG equ 0
  170. CONFIG_REALTIME_ONLY equ 1
  171. 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
  172. --- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
  173. +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
  174. @@ -51,7 +51,7 @@
  175. #define CONFIG_OPTICAL_FLOW_API 0
  176. #define CONFIG_OS_SUPPORT 1
  177. #define CONFIG_PARTITION_SEARCH_ORDER 0
  178. -#define CONFIG_PIC 0
  179. +#define CONFIG_PIC 1
  180. #define CONFIG_RD_COMMAND 0
  181. #define CONFIG_RD_DEBUG 0
  182. #define CONFIG_REALTIME_ONLY 1
  183. 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
  184. --- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
  185. +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
  186. @@ -39,7 +39,7 @@
  187. %define CONFIG_OPTICAL_FLOW_API 0
  188. %define CONFIG_OS_SUPPORT 1
  189. %define CONFIG_PARTITION_SEARCH_ORDER 0
  190. -%define CONFIG_PIC 0
  191. +%define CONFIG_PIC 1
  192. %define CONFIG_RD_COMMAND 0
  193. %define CONFIG_RD_DEBUG 0
  194. %define CONFIG_REALTIME_ONLY 1
  195. 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
  196. --- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
  197. +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
  198. @@ -51,7 +51,7 @@
  199. #define CONFIG_OPTICAL_FLOW_API 0
  200. #define CONFIG_OS_SUPPORT 1
  201. #define CONFIG_PARTITION_SEARCH_ORDER 0
  202. -#define CONFIG_PIC 0
  203. +#define CONFIG_PIC 1
  204. #define CONFIG_RD_COMMAND 0
  205. #define CONFIG_RD_DEBUG 0
  206. #define CONFIG_REALTIME_ONLY 1
  207. --
  208. 2.20.1