History

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.

Stephen Hutchinson committed 2 years ago

Commit ea7375c1 parent 48d6cd31 file · +11 −11Browse files

Unified · Split

libavformat/avisynth.c+11−11
@@ -118,17 +118,6 @@ typedef struct AviSynthContext { · 117 unmodified lines
118 struct AviSynthLibrary avs_library;118 struct AviSynthLibrary avs_library;
119} AviSynthContext;119} AviSynthContext;
120 120
121static const int avs_planes_packed[1] = { 0 };
122static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
123static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
124 AVS_PLANAR_V };
125static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
126 AVS_PLANAR_R };
127static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
128 AVS_PLANAR_V, AVS_PLANAR_A };
129static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
130 AVS_PLANAR_R, AVS_PLANAR_A };
131
132static av_cold int avisynth_load_library(AviSynthContext *avs)121static av_cold int avisynth_load_library(AviSynthContext *avs)
133{122{
134 avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL);123 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) · 90 unmodified lines
225 int sar_num = 1;214 int sar_num = 1;
226 int sar_den = 1;215 int sar_den = 1;
227 216
217 static const int avs_planes_packed[1] = { 0 };
218 static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
219 static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
220 AVS_PLANAR_V };
221 static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
222 AVS_PLANAR_R };
223 static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
224 AVS_PLANAR_V, AVS_PLANAR_A };
225 static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
226 AVS_PLANAR_R, AVS_PLANAR_A };
227
228 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;228 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
229 st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;229 st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
230 st->codecpar->width = avs->vi->width;230 st->codecpar->width = avs->vi->width;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t