Previously, the 420 version was used even for 422. This fixes occasional checkasm failures.
Showing the changes to libavcodec/arm (2 of 2 files). Show all
Unified · Split
| @@ -33,6 +33,8 @@ void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, · 32 unmodified lines | |||
| 33 | int beta, int8_t *tc0); | 33 | int beta, int8_t *tc0); |
| 34 | void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, | 34 | void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, |
| 35 | int beta, int8_t *tc0); | 35 | int beta, int8_t *tc0); |
| 36 | void ff_h264_h_loop_filter_chroma422_neon(uint8_t *pix, int stride, int alpha, | ||
| 37 | int beta, int8_t *tc0); | ||
| 36 | 38 | ||
| 37 | void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height, | 39 | void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height, |
| 38 | int log2_den, int weight, int offset); | 40 | int log2_den, int weight, int offset); |
| @@ -76,7 +78,11 @@ static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth, · 37 unmodified lines | |||
| 76 | c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon; | 78 | c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon; |
| 77 | c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon; | 79 | c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon; |
| 78 | c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon; | 80 | c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon; |
| 79 | c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon; | 81 | |
| 82 | if (chroma_format_idc <= 1) | ||
| 83 | c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon; | ||
| 84 | else | ||
| 85 | c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma422_neon; | ||
| 80 | 86 | ||
| 81 | c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon; | 87 | c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon; |
| 82 | c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon; | 88 | c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon; |
| @@ -237,6 +237,7 @@ function ff_h264_h_loop_filter_chroma_neon, export=1 · 236 unmodified lines | |||
| 237 | h264_loop_filter_start | 237 | h264_loop_filter_start |
| 238 | 238 | ||
| 239 | sub r0, r0, #2 | 239 | sub r0, r0, #2 |
| 240 | h_loop_filter_chroma420: | ||
| 240 | vld1.32 {d18[0]}, [r0], r1 | 241 | vld1.32 {d18[0]}, [r0], r1 |
| 241 | vld1.32 {d16[0]}, [r0], r1 | 242 | vld1.32 {d16[0]}, [r0], r1 |
| 242 | vld1.32 {d0[0]}, [r0], r1 | 243 | vld1.32 {d0[0]}, [r0], r1 |
| @@ -271,6 +272,24 @@ function ff_h264_h_loop_filter_chroma_neon, export=1 · 28 unmodified lines | |||
| 271 | bx lr | 272 | bx lr |
| 272 | endfunc | 273 | endfunc |
| 273 | 274 | ||
| 275 | function ff_h264_h_loop_filter_chroma422_neon, export=1 | ||
| 276 | h264_loop_filter_start | ||
| 277 | push {r4, lr} | ||
| 278 | add r4, r0, r1 | ||
| 279 | add r1, r1, r1 | ||
| 280 | sub r0, r0, #2 | ||
| 281 | |||
| 282 | bl h_loop_filter_chroma420 | ||
| 283 | |||
| 284 | ldr r12, [sp, #8] | ||
| 285 | ldr r12, [r12] | ||
| 286 | vmov.32 d24[0], r12 | ||
| 287 | sub r0, r4, #2 | ||
| 288 | |||
| 289 | bl h_loop_filter_chroma420 | ||
| 290 | pop {r4, pc} | ||
| 291 | endfunc | ||
| 292 | |||
| 274 | @ Biweighted prediction | 293 | @ Biweighted prediction |
| 275 | 294 | ||
| 276 | .macro biweight_16 macs, macd | 295 | .macro biweight_16 macs, macd |