[FFmpeg-cvslog] avformat/avisynth: move avs_planes* consts into relevant function
Stephen Hutchinson
git at videolan.org
Tue Aug 13 22:16:59 EEST 2024
ffmpeg | branch: master | Stephen Hutchinson <qyot27 at gmail.com> | Sun Jul 28 14:49:40 2024 -0400| [ea7375c9e94ee572d2cbe7ca25fc94ee8a5038b5] | committer: Stephen Hutchinson
avformat/avisynth: move avs_planes* consts into relevant function
These consts are only used in the switch(planar) case located in
avisynth_create_stream_video and nowhere else in the demuxer,
so move them into that function directly.
Signed-off-by: Stephen Hutchinson <qyot27 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea7375c9e94ee572d2cbe7ca25fc94ee8a5038b5
---
libavformat/avisynth.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index b91d77b8d8..cb2be10925 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -118,17 +118,6 @@ typedef struct AviSynthContext {
struct AviSynthLibrary avs_library;
} AviSynthContext;
-static const int avs_planes_packed[1] = { 0 };
-static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
-static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
- AVS_PLANAR_V };
-static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
- AVS_PLANAR_R };
-static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
- AVS_PLANAR_V, AVS_PLANAR_A };
-static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
- AVS_PLANAR_R, AVS_PLANAR_A };
-
static av_cold int avisynth_load_library(AviSynthContext *avs)
{
avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL);
@@ -225,6 +214,17 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
int sar_num = 1;
int sar_den = 1;
+ static const int avs_planes_packed[1] = { 0 };
+ static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
+ static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
+ AVS_PLANAR_V };
+ static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
+ AVS_PLANAR_R };
+ static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
+ AVS_PLANAR_V, AVS_PLANAR_A };
+ static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
+ AVS_PLANAR_R, AVS_PLANAR_A };
+
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
st->codecpar->width = avs->vi->width;
More information about the ffmpeg-cvslog
mailing list