History

arm: Implement a NEON version of 422 h264_h_loop_filter_chroma

Previously, the 420 version was used even for 422. This fixes occasional checkasm failures.

Martin Storsjö committed 7 years ago

Commit 0676de91 parent f8abf7d2 files · +26 −1Browse files

Unified · Split

2 files
  1. libavcodec/arm/h264dsp_init_arm.c +7 −1
  2. libavcodec/arm/h264dsp_neon.S +19 −0
libavcodec/arm/h264dsp_init_arm.c+7−1
@@ -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);
34void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,34void 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);
36void ff_h264_h_loop_filter_chroma422_neon(uint8_t *pix, int stride, int alpha,
37 int beta, int8_t *tc0);
36 38
37void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,39void 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;
libavcodec/arm/h264dsp_neon.S+19−0
@@ -237,6 +237,7 @@ function ff_h264_h_loop_filter_chroma_neon, export=1 · 236 unmodified lines
237 h264_loop_filter_start237 h264_loop_filter_start
238 238
239 sub r0, r0, #2239 sub r0, r0, #2
240h_loop_filter_chroma420:
240 vld1.32 {d18[0]}, [r0], r1241 vld1.32 {d18[0]}, [r0], r1
241 vld1.32 {d16[0]}, [r0], r1242 vld1.32 {d16[0]}, [r0], r1
242 vld1.32 {d0[0]}, [r0], r1243 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 lr272 bx lr
272endfunc273endfunc
273 274
275function 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}
291endfunc
292
274@ Biweighted prediction293@ Biweighted prediction
275 294
276.macro biweight_16 macs, macd295.macro biweight_16 macs, macd

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t