[FFmpeg-devel] [PATCH 7/9] dct-test: add infrastructure for 10 bits
Michael Niedermayer
michael at niedermayer.cc
Sat Oct 10 13:12:19 CEST 2015
On Fri, Oct 09, 2015 at 11:53:44PM +0200, Christophe Gisquet wrote:
> ---
> libavcodec/arm/dct-test.c | 10 ++++++++--
> libavcodec/dct-test.c | 41 +++++++++++++++++++++++++++++++++++------
> libavcodec/ppc/dct-test.c | 10 ++++++++--
> libavcodec/x86/dct-test.c | 9 +++++++--
> 4 files changed, 58 insertions(+), 12 deletions(-)
>
> diff --git a/libavcodec/arm/dct-test.c b/libavcodec/arm/dct-test.c
> index f9076b3..fd86b9d 100644
> --- a/libavcodec/arm/dct-test.c
> +++ b/libavcodec/arm/dct-test.c
> @@ -20,11 +20,11 @@
>
> #include "idct.h"
>
> -static const struct algo fdct_tab_arch[] = {
> +static const struct algo fdct_tab_arch8[] = {
> { 0 }
> };
>
> -static const struct algo idct_tab_arch[] = {
> +static const struct algo idct_tab_arch8[] = {
> { "SIMPLE-ARM", ff_simple_idct_arm, FF_IDCT_PERM_NONE },
> { "INT-ARM", ff_j_rev_dct_arm, FF_IDCT_PERM_LIBMPEG2 },
> #if HAVE_ARMV5TE
> @@ -38,3 +38,9 @@ static const struct algo idct_tab_arch[] = {
> #endif
> { 0 }
> };
> +
> +static const struct algo fdct_tab_arch10[] = { { 0 } };
> +static const struct algo idct_tab_arch10[] = { { 0 } };
> +static const struct algo fdct_tab_arch12[] = { { 0 } };
> +static const struct algo idct_tab_arch12[] = { { 0 } };
> +
> diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
> index 56e1a62..9a195ab 100644
> --- a/libavcodec/dct-test.c
> +++ b/libavcodec/dct-test.c
> @@ -56,13 +56,19 @@ struct algo {
> int nonspec;
> };
>
> -static const struct algo fdct_tab[] = {
> +static const struct algo fdct_tab8[] = {
> { "REF-DBL", ff_ref_fdct, FF_IDCT_PERM_NONE },
> { "IJG-AAN-INT", ff_fdct_ifast, FF_IDCT_PERM_NONE },
> { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
> #if CONFIG_FAANDCT
> { "FAAN", ff_faandct, FF_IDCT_PERM_NONE },
> #endif /* CONFIG_FAANDCT */
> + { 0 }
> +};
> +
> +static const struct algo fdct_tab10[] = {
> + { "IJG-LLM-INT10", ff_jpeg_fdct_islow_10, FF_IDCT_PERM_NONE },
> + { 0 }
> };
>
> static void ff_prores_idct_wrap(int16_t *dst){
> @@ -78,7 +84,7 @@ static void ff_prores_idct_wrap(int16_t *dst){
> }
> }
>
> -static const struct algo idct_tab[] = {
> +static const struct algo idct_tab8[] = {
> { "REF-DBL", ff_ref_idct, FF_IDCT_PERM_NONE },
> { "INT", ff_j_rev_dct, FF_IDCT_PERM_LIBMPEG2 },
> { "SIMPLE-C", ff_simple_idct_8, FF_IDCT_PERM_NONE },
> @@ -89,6 +95,12 @@ static const struct algo idct_tab[] = {
> #if CONFIG_MPEG4_DECODER
> { "XVID", ff_xvid_idct, FF_IDCT_PERM_NONE, 0, 1 },
> #endif /* CONFIG_MPEG4_DECODER */
> + { 0 }
> +};
> +
> +static const struct algo idct_tab10[] = {
> + { "SIMPLE10-C", ff_simple_idct_10, FF_IDCT_PERM_NONE },
> + { 0 }
> };
>
> #if ARCH_ARM
> @@ -98,8 +110,10 @@ static const struct algo idct_tab[] = {
> #elif ARCH_X86
> #include "x86/dct-test.c"
> #else
> -static const struct algo fdct_tab_arch[] = { { 0 } };
> -static const struct algo idct_tab_arch[] = { { 0 } };
> +static const struct algo fdct_tab_arch8[] = { { 0 } };
> +static const struct algo idct_tab_arch8[] = { { 0 } };
> +static const struct algo fdct_tab_arch10[] = { { 0 } };
> +static const struct algo idct_tab_arch10[] = { { 0 } };
> #endif
>
> #define AANSCALE_BITS 12
> @@ -451,6 +465,10 @@ static void help(void)
>
> int main(int argc, char **argv)
> {
> + const struct algo* idct_tab = NULL;
> + const struct algo* fdct_tab = NULL;
> + const struct algo* fdct_tab_arch = NULL;
> + const struct algo* idct_tab_arch = NULL;
> int test_idct = 0, test_248_dct = 0;
> int c, i;
> int test = 1;
> @@ -491,8 +509,19 @@ int main(int argc, char **argv)
> idct248_error("SIMPLE-C", ff_simple_idct248_put, speed);
> } else {
> const int cpu_flags = av_get_cpu_flags();
> + switch(bits) {
> + case 8:
> + idct_tab = idct_tab8; fdct_tab = fdct_tab8;
> + idct_tab_arch = idct_tab_arch8; fdct_tab_arch = fdct_tab_arch8;
> + break;
> + case 10:
> + idct_tab = idct_tab10; fdct_tab = fdct_tab10;
> + idct_tab_arch = idct_tab_arch10; fdct_tab_arch = fdct_tab_arch10;
> + break;
> + default: fprintf(stderr, "No tests for %i bits\n", bits); return 1;
this breaks testing the (i)dcts with other bits than 8 bits
example:
libavcodec/dct-test 0 9
libavcodec/dct-test -i 0 9
also it seems some of the "8bit" (i)dcts work fine with 10 and 12bit
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151010/9e03b5f9/attachment.sig>
More information about the ffmpeg-devel
mailing list