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
118118 struct AviSynthLibrary avs_library;
119119 } AviSynthContext;
120120
121−static const int avs_planes_packed[1] = { 0 };
122−static const int avs_planes_grey[1] = { AVS_PLANAR_Y };
123−static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U,
124− AVS_PLANAR_V };
125−static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B,
126− AVS_PLANAR_R };
127−static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U,
128− AVS_PLANAR_V, AVS_PLANAR_A };
129−static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B,
130− AVS_PLANAR_R, AVS_PLANAR_A };
131−
132121 static av_cold int avisynth_load_library(AviSynthContext *avs)
133122 {
134123 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
225214 int sar_num = 1;
226215 int sar_den = 1;
227216
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+
228228 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
229229 st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
230230 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