Drop the mpegvideo dependency for svq3 in configure.
---
 configure              |  2 +-
 libavcodec/internal.h  |  7 +++++++
 libavcodec/mpegvideo.c | 50 -----------------------------------------------
 libavcodec/mpegvideo.h |  3 ---
 libavcodec/utils.c     | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 61 insertions(+), 54 deletions(-)

diff --git a/configure b/configure
index 4d7382a..e0dc66f 100755
--- a/configure
+++ b/configure
@@ -1766,7 +1766,7 @@ sipr_decoder_select="lsp"
 sp5x_decoder_select="mjpeg_decoder"
 svq1_decoder_select="hpeldsp"
 svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
-svq3_decoder_select="h264_decoder hpeldsp mpegvideo"
+svq3_decoder_select="h264_decoder hpeldsp"
 svq3_decoder_suggest="zlib"
 tak_decoder_select="dsputil"
 theora_decoder_select="vp3_decoder"
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 9f7213c..3949e0f 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -186,4 +186,11 @@ int ff_set_dimensions(AVCodecContext *s, int width, int 
height);
 int ff_side_data_update_matrix_encoding(AVFrame *frame,
                                         enum AVMatrixEncoding matrix_encoding);
 
+/**
+ * Draw a horizontal band if supported.
+ */
+void ff_draw_horiz_band(AVCodecContext *avctx,
+                        AVFrame *cur, AVFrame *last,
+                        int y, int h, int picture_structure,
+                        int first_field, int low_delay);
 #endif /* AVCODEC_INTERNAL_H */
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 2452310..b832efc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2315,56 +2315,6 @@ void ff_MPV_decode_mb(MpegEncContext *s, int16_t 
block[12][64]){
 /**
  * @param h is the normal height, this will be reduced automatically if needed 
for the last row
  */
-void ff_draw_horiz_band(AVCodecContext *avctx,
-                        AVFrame *cur, AVFrame *last,
-                        int y, int h, int picture_structure,
-                        int first_field, int low_delay)
-{
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-    int vshift = desc->log2_chroma_h;
-    const int field_pic = picture_structure != PICT_FRAME;
-    if(field_pic){
-        h <<= 1;
-        y <<= 1;
-    }
-
-    h = FFMIN(h, avctx->height - y);
-
-    if(field_pic && first_field && 
!(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
-
-    if (avctx->draw_horiz_band) {
-        AVFrame *src;
-        int offset[AV_NUM_DATA_POINTERS];
-        int i;
-
-        if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay ||
-           (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
-            src = cur;
-        else if (last)
-            src = last;
-        else
-            return;
-
-        if (cur->pict_type == AV_PICTURE_TYPE_B &&
-            picture_structure == PICT_FRAME &&
-            avctx->codec_id != AV_CODEC_ID_SVQ3) {
-            for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
-                offset[i] = 0;
-        }else{
-            offset[0]= y * src->linesize[0];
-            offset[1]=
-            offset[2]= (y >> vshift) * src->linesize[1];
-            for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-                offset[i] = 0;
-        }
-
-        emms_c();
-
-        avctx->draw_horiz_band(avctx, src, offset,
-                               y, picture_structure, h);
-    }
-}
-
 void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
 {
     ff_draw_horiz_band(s->avctx, &s->current_picture.f,
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 11891b4..27fe6e8 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -710,9 +710,6 @@ void ff_MPV_common_init_x86(MpegEncContext *s);
 void ff_MPV_common_init_arm(MpegEncContext *s);
 void ff_MPV_common_init_ppc(MpegEncContext *s);
 void ff_clean_intra_table_entries(MpegEncContext *s);
-void ff_draw_horiz_band(AVCodecContext *avctx, AVFrame *cur, AVFrame *last,
-                        int y, int h, int picture_structure, int first_field,
-                        int low_delay);
 void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
 void ff_mpeg_flush(AVCodecContext *avctx);
 void ff_print_debug_info(MpegEncContext *s, Picture *p);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c88b346..530847f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -44,6 +44,7 @@
 #include "thread.h"
 #include "internal.h"
 #include "bytestream.h"
+#include "picttype.h"
 #include "version.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2333,3 +2334,55 @@ const uint8_t *avpriv_find_start_code(const uint8_t 
*restrict p,
 
     return p + 4;
 }
+
+void ff_draw_horiz_band(AVCodecContext *avctx,
+                        AVFrame *cur, AVFrame *last,
+                        int y, int h, int picture_structure,
+                        int first_field, int low_delay)
+{
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+    int vshift = desc->log2_chroma_h;
+    const int field_pic = picture_structure != PICT_FRAME;
+    if (field_pic) {
+        h <<= 1;
+        y <<= 1;
+    }
+
+    h = FFMIN(h, avctx->height - y);
+
+    if (field_pic && first_field &&
+        !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
+        return;
+
+    if (avctx->draw_horiz_band) {
+        AVFrame *src;
+        int offset[AV_NUM_DATA_POINTERS];
+        int i;
+
+        if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay ||
+           (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
+            src = cur;
+        else if (last)
+            src = last;
+        else
+            return;
+
+        if (cur->pict_type == AV_PICTURE_TYPE_B &&
+            picture_structure == PICT_FRAME &&
+            avctx->codec_id != AV_CODEC_ID_SVQ3) {
+            for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
+                offset[i] = 0;
+        } else {
+            offset[0]= y * src->linesize[0];
+            offset[1]=
+            offset[2]= (y >> vshift) * src->linesize[1];
+            for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
+                offset[i] = 0;
+        }
+
+        emms_c();
+
+        avctx->draw_horiz_band(avctx, src, offset,
+                               y, picture_structure, h);
+    }
+}
-- 
1.8.3.4 (Apple Git-47)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to