AV1-codec-support.patch 9.3 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. @@ -81,7 +81,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. @@ -192,7 +192,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. @@ -242,6 +242,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. @@ -629,6 +629,11 @@ aom_mem_sources = [
  54. aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/emms.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. @@ -46,7 +46,7 @@ CONFIG_NN_V2 equ 0
  67. CONFIG_NORMAL_TILE_MODE equ 1
  68. CONFIG_OPTICAL_FLOW_API equ 0
  69. CONFIG_OS_SUPPORT equ 1
  70. -CONFIG_PIC equ 0
  71. +CONFIG_PIC equ 1
  72. CONFIG_RD_DEBUG equ 0
  73. CONFIG_REALTIME_ONLY equ 1
  74. CONFIG_RT_ML_PARTITIONING equ 0
  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. @@ -48,7 +48,7 @@
  79. #define CONFIG_NORMAL_TILE_MODE 1
  80. #define CONFIG_OPTICAL_FLOW_API 0
  81. #define CONFIG_OS_SUPPORT 1
  82. -#define CONFIG_PIC 0
  83. +#define CONFIG_PIC 1
  84. #define CONFIG_RD_DEBUG 0
  85. #define CONFIG_REALTIME_ONLY 1
  86. #define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -46,7 +46,7 @@ CONFIG_NN_V2 equ 0
  91. CONFIG_NORMAL_TILE_MODE equ 1
  92. CONFIG_OPTICAL_FLOW_API equ 0
  93. CONFIG_OS_SUPPORT equ 1
  94. -CONFIG_PIC equ 0
  95. +CONFIG_PIC equ 1
  96. CONFIG_RD_DEBUG equ 0
  97. CONFIG_REALTIME_ONLY equ 1
  98. CONFIG_RT_ML_PARTITIONING equ 0
  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. @@ -48,7 +48,7 @@
  103. #define CONFIG_NORMAL_TILE_MODE 1
  104. #define CONFIG_OPTICAL_FLOW_API 0
  105. #define CONFIG_OS_SUPPORT 1
  106. -#define CONFIG_PIC 0
  107. +#define CONFIG_PIC 1
  108. #define CONFIG_RD_DEBUG 0
  109. #define CONFIG_REALTIME_ONLY 1
  110. #define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -46,7 +46,7 @@ CONFIG_NN_V2 equ 0
  115. CONFIG_NORMAL_TILE_MODE equ 1
  116. CONFIG_OPTICAL_FLOW_API equ 0
  117. CONFIG_OS_SUPPORT equ 1
  118. -CONFIG_PIC equ 0
  119. +CONFIG_PIC equ 1
  120. CONFIG_RD_DEBUG equ 0
  121. CONFIG_REALTIME_ONLY equ 1
  122. CONFIG_RT_ML_PARTITIONING equ 0
  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. @@ -48,7 +48,7 @@
  127. #define CONFIG_NORMAL_TILE_MODE 1
  128. #define CONFIG_OPTICAL_FLOW_API 0
  129. #define CONFIG_OS_SUPPORT 1
  130. -#define CONFIG_PIC 0
  131. +#define CONFIG_PIC 1
  132. #define CONFIG_RD_DEBUG 0
  133. #define CONFIG_REALTIME_ONLY 1
  134. #define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -46,7 +46,7 @@ CONFIG_NN_V2 equ 0
  139. CONFIG_NORMAL_TILE_MODE equ 1
  140. CONFIG_OPTICAL_FLOW_API equ 0
  141. CONFIG_OS_SUPPORT equ 1
  142. -CONFIG_PIC equ 0
  143. +CONFIG_PIC equ 1
  144. CONFIG_RD_DEBUG equ 0
  145. CONFIG_REALTIME_ONLY equ 1
  146. CONFIG_RT_ML_PARTITIONING equ 0
  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. @@ -48,7 +48,7 @@
  151. #define CONFIG_NORMAL_TILE_MODE 1
  152. #define CONFIG_OPTICAL_FLOW_API 0
  153. #define CONFIG_OS_SUPPORT 1
  154. -#define CONFIG_PIC 0
  155. +#define CONFIG_PIC 1
  156. #define CONFIG_RD_DEBUG 0
  157. #define CONFIG_REALTIME_ONLY 1
  158. #define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -46,7 +46,7 @@ CONFIG_NN_V2 equ 0
  163. CONFIG_NORMAL_TILE_MODE equ 1
  164. CONFIG_OPTICAL_FLOW_API equ 0
  165. CONFIG_OS_SUPPORT equ 1
  166. -CONFIG_PIC equ 0
  167. +CONFIG_PIC equ 1
  168. CONFIG_RD_DEBUG equ 0
  169. CONFIG_REALTIME_ONLY equ 1
  170. CONFIG_RT_ML_PARTITIONING equ 0
  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. @@ -48,7 +48,7 @@
  175. #define CONFIG_NORMAL_TILE_MODE 1
  176. #define CONFIG_OPTICAL_FLOW_API 0
  177. #define CONFIG_OS_SUPPORT 1
  178. -#define CONFIG_PIC 0
  179. +#define CONFIG_PIC 1
  180. #define CONFIG_RD_DEBUG 0
  181. #define CONFIG_REALTIME_ONLY 1
  182. #define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -36,7 +36,7 @@
  187. %define CONFIG_NORMAL_TILE_MODE 1
  188. %define CONFIG_OPTICAL_FLOW_API 0
  189. %define CONFIG_OS_SUPPORT 1
  190. -%define CONFIG_PIC 0
  191. +%define CONFIG_PIC 1
  192. %define CONFIG_RD_DEBUG 0
  193. %define CONFIG_REALTIME_ONLY 1
  194. %define CONFIG_RT_ML_PARTITIONING 0
  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. @@ -48,7 +48,7 @@
  199. #define CONFIG_NORMAL_TILE_MODE 1
  200. #define CONFIG_OPTICAL_FLOW_API 0
  201. #define CONFIG_OS_SUPPORT 1
  202. -#define CONFIG_PIC 0
  203. +#define CONFIG_PIC 1
  204. #define CONFIG_RD_DEBUG 0
  205. #define CONFIG_REALTIME_ONLY 1
  206. #define CONFIG_RT_ML_PARTITIONING 0
  207. --
  208. 2.17.1