]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: add simpleauto idct
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Jun 2014 16:55:27 +0000 (18:55 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Jun 2014 12:28:01 +0000 (14:28 +0200)
This will pick the "best" simple idct compatible idct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/codecs.texi
libavcodec/arm/dsputil_init_armv5te.c
libavcodec/arm/dsputil_init_neon.c
libavcodec/avcodec.h
libavcodec/options_table.h
libavcodec/x86/dsputil_init.c

index b5255cbdc4349e7c09a0947aea205603467e90f9..e1a244d6adf429e1f9bce801d882d8b36210e2f2 100644 (file)
@@ -394,6 +394,9 @@ Possible values:
 
 @item simplemmx
 
+@item simpleauto
+Automatically pick a IDCT compatible with the simple one
+
 @item arm
 
 @item altivec
index 883f6e40ad4c719de49c0fd02dbcc3659ea29867..0ba4f453ee043432bf36407d15977c6f7c505b0d 100644 (file)
@@ -34,6 +34,7 @@ av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx,
 {
     if (!avctx->lowres && !high_bit_depth &&
         (avctx->idct_algo == FF_IDCT_AUTO ||
+         avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
          avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
         c->idct_put              = ff_simple_idct_put_armv5te;
         c->idct_add              = ff_simple_idct_add_armv5te;
index 2d30d401179ea946776c5444c61093f10ad86349..797983c76cc1690472e0b2ae1a1908892e9a82ad 100644 (file)
@@ -46,6 +46,7 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
 {
     if (!avctx->lowres && !high_bit_depth) {
         if (avctx->idct_algo == FF_IDCT_AUTO ||
+            avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
             avctx->idct_algo == FF_IDCT_SIMPLENEON) {
             c->idct_put              = ff_simple_idct_put_neon;
             c->idct_add              = ff_simple_idct_add_neon;
index 7cf53b4848c3881162a4ceb85f861724ca25bf54..2579ccc97129e6f5018f14d0881f70ce231e0d02 100644 (file)
@@ -2667,6 +2667,7 @@ typedef struct AVCodecContext {
 #if FF_API_ARCH_ALPHA
 #define FF_IDCT_SIMPLEALPHA   23
 #endif
+#define FF_IDCT_SIMPLEAUTO    128
 
     /**
      * bits per sample/pixel from the demuxer (needed for huffyuv).
index 9bfd750517e21072eb3b7883fe91a65a270e0e5e..6185e67937e1b71d5a90919d268976d8873fda03 100644 (file)
@@ -219,6 +219,7 @@ static const AVOption avcodec_options[] = {
 {"ipp", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
 {"xvidmmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
 {"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
+{"simpleauto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEAUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
 {"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
 {"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, "ec"},
 {"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
index 1ab1a0ae594a727c825c7e606ba8650eeccc5d28..5c12364c237128fec2a0913ab66afb97008d3a28 100644 (file)
@@ -60,6 +60,7 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
     if (avctx->lowres == 0 && !high_bit_depth) {
         switch (avctx->idct_algo) {
         case FF_IDCT_AUTO:
+        case FF_IDCT_SIMPLEAUTO:
         case FF_IDCT_SIMPLEMMX:
             c->idct_put              = ff_simple_idct_put_mmx;
             c->idct_add              = ff_simple_idct_add_mmx;