[FFmpeg-devel] [PATCH 2/2] avcodec/h263, h263data: Move ff_h263_init_rl_inter to h263.c

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri May 7 19:02:18 EEST 2021


The SVQ1 decoder does not need mpegvideo or rl.c, but it uses stuff
from h263data.c. But since 61fe481586425a41d45e371de1e875b49882477d
h263data.c called ff_rl_init() and this of course led to build errors
when the SVQ1 decoder is enabled and mpegvideo disabled.

Fix this by moving ff_h263_init_rl_inter() to h263.c.
Fixes ticket #9224.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/h263.c     | 11 +++++++++++
 libavcodec/h263.h     |  1 +
 libavcodec/h263data.c | 12 ------------
 libavcodec/h263data.h |  1 -
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index bc5c0d599f..fcd68adebb 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -38,6 +38,17 @@
 #include "flv.h"
 #include "mpeg4video.h"
 
+static av_cold void h263_init_rl_inter(void)
+{
+    static uint8_t h263_rl_inter_table[2][2 * MAX_RUN + MAX_LEVEL + 3];
+    ff_rl_init(&ff_h263_rl_inter, h263_rl_inter_table);
+}
+
+av_cold void ff_h263_init_rl_inter(void)
+{
+    static AVOnce init_static_once = AV_ONCE_INIT;
+    ff_thread_once(&init_static_once, h263_init_rl_inter);
+}
 
 void ff_h263_update_motion_val(MpegEncContext * s){
     const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
diff --git a/libavcodec/h263.h b/libavcodec/h263.h
index 998f7d0d59..491f2e0aac 100644
--- a/libavcodec/h263.h
+++ b/libavcodec/h263.h
@@ -66,6 +66,7 @@ int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
                              int *px, int *py);
 void ff_h263_encode_init(MpegEncContext *s);
 void ff_h263_decode_init_vlc(void);
+void ff_h263_init_rl_inter(void);
 int ff_h263_decode_picture_header(MpegEncContext *s);
 int ff_h263_decode_gob_header(MpegEncContext *s);
 void ff_h263_update_motion_val(MpegEncContext * s);
diff --git a/libavcodec/h263data.c b/libavcodec/h263data.c
index 604a0425e1..37e35bab87 100644
--- a/libavcodec/h263data.c
+++ b/libavcodec/h263data.c
@@ -290,15 +290,3 @@ const AVRational ff_h263_pixel_aspect[16] = {
     {  0,  1 },
     {  0,  1 },
 };
-
-static av_cold void h263_init_rl_inter(void)
-{
-    static uint8_t h263_rl_inter_table[2][2 * MAX_RUN + MAX_LEVEL + 3];
-    ff_rl_init(&ff_h263_rl_inter, h263_rl_inter_table);
-}
-
-av_cold void ff_h263_init_rl_inter(void)
-{
-    static AVOnce init_static_once = AV_ONCE_INIT;
-    ff_thread_once(&init_static_once, h263_init_rl_inter);
-}
diff --git a/libavcodec/h263data.h b/libavcodec/h263data.h
index 144704d12b..06554bdf0d 100644
--- a/libavcodec/h263data.h
+++ b/libavcodec/h263data.h
@@ -61,7 +61,6 @@ extern const int8_t ff_inter_run[102];
 
 extern RLTable ff_h263_rl_inter;
 extern RLTable ff_rl_intra_aic;
-void ff_h263_init_rl_inter(void);
 
 extern const uint16_t ff_h263_format[8][2];
 
-- 
2.27.0



More information about the ffmpeg-devel mailing list