[FFmpeg-cvslog] avcodec: add simpleauto idct

Michael Niedermayer git at videolan.org
Thu Jun 19 14:57:30 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 14 18:55:27 2014 +0200| [08c5859f17ed6c16d7e59ea63c63d85cc0d9427f] | committer: Michael Niedermayer

avcodec: add simpleauto idct

This will pick the "best" simple idct compatible idct

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08c5859f17ed6c16d7e59ea63c63d85cc0d9427f
---

 doc/codecs.texi                       |    3 +++
 libavcodec/arm/dsputil_init_armv5te.c |    1 +
 libavcodec/arm/dsputil_init_neon.c    |    1 +
 libavcodec/avcodec.h                  |    1 +
 libavcodec/options_table.h            |    1 +
 libavcodec/x86/dsputil_init.c         |    1 +
 6 files changed, 8 insertions(+)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index b5255cb..e1a244d 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -394,6 +394,9 @@ Possible values:
 
 @item simplemmx
 
+ at item simpleauto
+Automatically pick a IDCT compatible with the simple one
+
 @item arm
 
 @item altivec
diff --git a/libavcodec/arm/dsputil_init_armv5te.c b/libavcodec/arm/dsputil_init_armv5te.c
index 883f6e4..0ba4f45 100644
--- a/libavcodec/arm/dsputil_init_armv5te.c
+++ b/libavcodec/arm/dsputil_init_armv5te.c
@@ -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;
diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c
index 2d30d40..797983c 100644
--- a/libavcodec/arm/dsputil_init_neon.c
+++ b/libavcodec/arm/dsputil_init_neon.c
@@ -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;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7cf53b4..2579ccc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -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).
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 9bfd750..6185e67 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -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"},
diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c
index 1ab1a0a..5c12364 100644
--- a/libavcodec/x86/dsputil_init.c
+++ b/libavcodec/x86/dsputil_init.c
@@ -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;



More information about the ffmpeg-cvslog mailing list