You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavc: deprecate AVCodecContext.color_table_id.
It's currently only used as temporary storage by the mov demuxer. Make it use a local variable instead.
This commit is contained in:
@@ -1684,13 +1684,15 @@ typedef struct AVCodecContext {
|
|||||||
*/
|
*/
|
||||||
int inter_quant_bias;
|
int inter_quant_bias;
|
||||||
|
|
||||||
|
#if FF_API_COLOR_TABLE_ID
|
||||||
/**
|
/**
|
||||||
* color table ID
|
* color table ID
|
||||||
* - encoding: unused
|
* - encoding: unused
|
||||||
* - decoding: Which clrtable should be used for 8bit RGB images.
|
* - decoding: Which clrtable should be used for 8bit RGB images.
|
||||||
* Tables have to be stored somewhere. FIXME
|
* Tables have to be stored somewhere. FIXME
|
||||||
*/
|
*/
|
||||||
int color_table_id;
|
attribute_deprecated int color_table_id;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* slice flags
|
* slice flags
|
||||||
|
@@ -297,7 +297,9 @@ static const AVOption options[]={
|
|||||||
{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
{"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
|
{"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
|
||||||
{"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
|
{"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
|
||||||
|
#if FF_API_COLOR_TABLE_ID
|
||||||
{"color_table_id", NULL, OFFSET(color_table_id), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
|
{"color_table_id", NULL, OFFSET(color_table_id), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
|
||||||
|
#endif
|
||||||
{"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
|
{"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
|
||||||
{"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"},
|
{"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"},
|
||||||
{"vlc", "variable length coder / huffman coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"},
|
{"vlc", "variable length coder / huffman coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"},
|
||||||
|
@@ -53,5 +53,8 @@
|
|||||||
#ifndef FF_API_MPV_GLOBAL_OPTS
|
#ifndef FF_API_MPV_GLOBAL_OPTS
|
||||||
#define FF_API_MPV_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 55)
|
#define FF_API_MPV_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef FF_API_COLOR_TABLE_ID
|
||||||
|
#define FF_API_COLOR_TABLE_ID (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
@@ -1180,6 +1180,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
|
|||||||
if (st->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
|
if (st->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
|
||||||
unsigned int color_depth, len;
|
unsigned int color_depth, len;
|
||||||
int color_greyscale;
|
int color_greyscale;
|
||||||
|
int color_table_id;
|
||||||
|
|
||||||
st->codec->codec_id = id;
|
st->codec->codec_id = id;
|
||||||
avio_rb16(pb); /* version */
|
avio_rb16(pb); /* version */
|
||||||
@@ -1207,9 +1208,9 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
|
|||||||
st->codec->codec_tag=MKTAG('I', '4', '2', '0');
|
st->codec->codec_tag=MKTAG('I', '4', '2', '0');
|
||||||
|
|
||||||
st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */
|
st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */
|
||||||
st->codec->color_table_id = avio_rb16(pb); /* colortable id */
|
color_table_id = avio_rb16(pb); /* colortable id */
|
||||||
av_dlog(c->fc, "depth %d, ctab id %d\n",
|
av_dlog(c->fc, "depth %d, ctab id %d\n",
|
||||||
st->codec->bits_per_coded_sample, st->codec->color_table_id);
|
st->codec->bits_per_coded_sample, color_table_id);
|
||||||
/* figure out the palette situation */
|
/* figure out the palette situation */
|
||||||
color_depth = st->codec->bits_per_coded_sample & 0x1F;
|
color_depth = st->codec->bits_per_coded_sample & 0x1F;
|
||||||
color_greyscale = st->codec->bits_per_coded_sample & 0x20;
|
color_greyscale = st->codec->bits_per_coded_sample & 0x20;
|
||||||
@@ -1236,7 +1237,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
|
|||||||
if (color_index < 0)
|
if (color_index < 0)
|
||||||
color_index = 0;
|
color_index = 0;
|
||||||
}
|
}
|
||||||
} else if (st->codec->color_table_id) {
|
} else if (color_table_id) {
|
||||||
const uint8_t *color_table;
|
const uint8_t *color_table;
|
||||||
/* if flag bit 3 is set, use the default palette */
|
/* if flag bit 3 is set, use the default palette */
|
||||||
color_count = 1 << color_depth;
|
color_count = 1 << color_depth;
|
||||||
|
Reference in New Issue
Block a user