Commit e5ffffe4 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Martin Storsjö

h264chroma: Remove duplicate 9/10 bit functions

These functions do the same thing in 16 bit space and don't need
any depth specific clipping.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 0c0828ec
...@@ -23,11 +23,7 @@ ...@@ -23,11 +23,7 @@
#include "h264chroma_template.c" #include "h264chroma_template.c"
#undef BIT_DEPTH #undef BIT_DEPTH
#define BIT_DEPTH 9 #define BIT_DEPTH 16
#include "h264chroma_template.c"
#undef BIT_DEPTH
#define BIT_DEPTH 10
#include "h264chroma_template.c" #include "h264chroma_template.c"
#undef BIT_DEPTH #undef BIT_DEPTH
...@@ -41,16 +37,10 @@ ...@@ -41,16 +37,10 @@
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth) void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
{ {
switch (bit_depth) { if (bit_depth > 8 && bit_depth <= 16) {
case 10: SET_CHROMA(16);
SET_CHROMA(10); } else {
break;
case 9:
SET_CHROMA(9);
break;
default:
SET_CHROMA(8); SET_CHROMA(8);
break;
} }
if (ARCH_ARM) if (ARCH_ARM)
......
...@@ -89,14 +89,14 @@ void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) ...@@ -89,14 +89,14 @@ void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_mmxext; c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_mmxext;
} }
if (EXTERNAL_MMXEXT(mm_flags) && bit_depth == 10) { if (EXTERNAL_MMXEXT(mm_flags) && bit_depth > 8 && bit_depth <= 10) {
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_10_mmxext; c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_10_mmxext;
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_10_mmxext; c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_10_mmxext;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_10_mmxext; c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_10_mmxext;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_10_mmxext; c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_10_mmxext;
} }
if (EXTERNAL_SSE2(mm_flags) && bit_depth == 10) { if (EXTERNAL_SSE2(mm_flags) && bit_depth > 8 && bit_depth <= 10) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_sse2; c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_sse2;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_sse2; c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_sse2;
} }
...@@ -108,7 +108,7 @@ void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) ...@@ -108,7 +108,7 @@ void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_ssse3; c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_ssse3;
} }
if (EXTERNAL_AVX(mm_flags) && bit_depth == 10) { if (EXTERNAL_AVX(mm_flags) && bit_depth > 8 && bit_depth <= 10) {
// AVX implies !cache64. // AVX implies !cache64.
// TODO: Port cache(32|64) detection from x264. // TODO: Port cache(32|64) detection from x264.
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx; c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment