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

Showing the changes to libavcodec/arm (2 of 2 files). Show all

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
3333 int beta, int8_t *tc0);
3434 void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
3535 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);
3638
3739 void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
3840 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
7678 c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
7779 c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
7880 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;
8086
8187 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
8288 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
237237 h264_loop_filter_start
238238
239239 sub r0, r0, #2
240+h_loop_filter_chroma420:
240241 vld1.32 {d18[0]}, [r0], r1
241242 vld1.32 {d16[0]}, [r0], r1
242243 vld1.32 {d0[0]}, [r0], r1
@@ -271,6 +272,24 @@ function ff_h264_h_loop_filter_chroma_neon, export=1 · 28 unmodified lines
271272 bx lr
272273 endfunc
273274
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+
274293 @ Biweighted prediction
275294
276295 .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