[FFmpeg-devel] [PATCH] avcodec/avdct: Add get_pixels()

Michael Niedermayer michaelni at gmx.at
Sat Aug 2 21:05:56 CEST 2014


TODO: version bump, update libavfilters to use it

Suggested-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/avdct.c |    9 +++++++++
 libavcodec/avdct.h |    4 ++++
 2 files changed, 13 insertions(+)

diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
index 58f4974..2521256 100644
--- a/libavcodec/avdct.c
+++ b/libavcodec/avdct.c
@@ -21,6 +21,7 @@
 #include "avcodec.h"
 #include "idctdsp.h"
 #include "fdctdsp.h"
+#include "pixblockdsp.h"
 #include "avdct.h"
 
 #define OFFSET(x) offsetof(AVDCT,x)
@@ -117,6 +118,14 @@ int avcodec_dct_init(AVDCT *dsp)
     }
 #endif
 
+#if CONFIG_PIXBLOCKDSP
+    {
+        PixblockDSPContext pdsp;
+        ff_pixblockdsp_init(&pdsp, avctx);
+        COPY(pdsp, get_pixels);
+    }
+#endif
+
     avcodec_close(avctx);
     av_free(avctx);
 
diff --git a/libavcodec/avdct.h b/libavcodec/avdct.h
index 4c9d00f..4190203 100644
--- a/libavcodec/avdct.h
+++ b/libavcodec/avdct.h
@@ -61,6 +61,10 @@ typedef struct AVDCT {
      * must use AVOptions to set this field.
      */
     int idct_algo;
+
+    void (*get_pixels)(int16_t *block /* align 16 */,
+                       const uint8_t *pixels /* align 8 */,
+                       int line_size);
 } AVDCT;
 
 /**
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list