mirror of https://git.ffmpeg.org/ffmpeg.git
avisynth: simplify the pix_fmt check for the newer AviSynth API
The values don't need to be hardcoded since the correct values are returned by avs_bits_per_pixel. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2e95054ebb
commit
0ed5c3ce81
|
@ -68,10 +68,6 @@ typedef struct AviSynthLibrary {
|
||||||
AVSC_DECLARE_FUNC(avs_get_pitch_p);
|
AVSC_DECLARE_FUNC(avs_get_pitch_p);
|
||||||
AVSC_DECLARE_FUNC(avs_get_read_ptr_p);
|
AVSC_DECLARE_FUNC(avs_get_read_ptr_p);
|
||||||
AVSC_DECLARE_FUNC(avs_get_row_size_p);
|
AVSC_DECLARE_FUNC(avs_get_row_size_p);
|
||||||
AVSC_DECLARE_FUNC(avs_is_yv24);
|
|
||||||
AVSC_DECLARE_FUNC(avs_is_yv16);
|
|
||||||
AVSC_DECLARE_FUNC(avs_is_yv411);
|
|
||||||
AVSC_DECLARE_FUNC(avs_is_y8);
|
|
||||||
#endif
|
#endif
|
||||||
#undef AVSC_DECLARE_FUNC
|
#undef AVSC_DECLARE_FUNC
|
||||||
} AviSynthLibrary;
|
} AviSynthLibrary;
|
||||||
|
@ -142,10 +138,6 @@ static av_cold int avisynth_load_library(void)
|
||||||
LOAD_AVS_FUNC(avs_get_pitch_p, 1);
|
LOAD_AVS_FUNC(avs_get_pitch_p, 1);
|
||||||
LOAD_AVS_FUNC(avs_get_read_ptr_p, 1);
|
LOAD_AVS_FUNC(avs_get_read_ptr_p, 1);
|
||||||
LOAD_AVS_FUNC(avs_get_row_size_p, 1);
|
LOAD_AVS_FUNC(avs_get_row_size_p, 1);
|
||||||
LOAD_AVS_FUNC(avs_is_yv24, 1);
|
|
||||||
LOAD_AVS_FUNC(avs_is_yv16, 1);
|
|
||||||
LOAD_AVS_FUNC(avs_is_yv411, 1);
|
|
||||||
LOAD_AVS_FUNC(avs_is_y8, 1);
|
|
||||||
#endif
|
#endif
|
||||||
#undef LOAD_AVS_FUNC
|
#undef LOAD_AVS_FUNC
|
||||||
|
|
||||||
|
@ -465,20 +457,11 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef USING_AVISYNTH
|
#ifdef USING_AVISYNTH
|
||||||
/* Define the bpp values for the new AviSynth 2.6 colorspaces.
|
/* avs_bits_per_pixel changed to AVSC_API with AviSynth 2.6, which
|
||||||
* Since AvxSynth doesn't have these functions, special-case
|
* requires going through avs_library, while AvxSynth has it under
|
||||||
* it in order to avoid implicit declaration errors. */
|
* the older AVSC_INLINE type, so special-case this. */
|
||||||
|
|
||||||
if (avs_library.avs_is_yv24(avs->vi))
|
bits = avs_library.avs_bits_per_pixel(avs->vi);
|
||||||
bits = 24;
|
|
||||||
else if (avs_library.avs_is_yv16(avs->vi))
|
|
||||||
bits = 16;
|
|
||||||
else if (avs_library.avs_is_yv411(avs->vi))
|
|
||||||
bits = 12;
|
|
||||||
else if (avs_library.avs_is_y8(avs->vi))
|
|
||||||
bits = 8;
|
|
||||||
else
|
|
||||||
bits = avs_library.avs_bits_per_pixel(avs->vi);
|
|
||||||
#else
|
#else
|
||||||
bits = avs_bits_per_pixel(avs->vi);
|
bits = avs_bits_per_pixel(avs->vi);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue