29#include "config_components.h"
56#if CONFIG_VC1_DXVA2_HWACCEL
59#if CONFIG_VC1_D3D11VA_HWACCEL
63#if CONFIG_VC1_D3D12VA_HWACCEL
66#if CONFIG_VC1_NVDEC_HWACCEL
69#if CONFIG_VC1_VAAPI_HWACCEL
72#if CONFIG_VC1_VDPAU_HWACCEL
79#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
81typedef struct SpriteData {
95 int effect_type, effect_flag;
96 int effect_pcount1, effect_pcount2;
97 int effect_params1[15], effect_params2[10];
105static void vc1_sprite_parse_transform(
GetBitContext* gb,
int c[7])
112 c[2] = get_fp_val(gb);
116 c[0] =
c[4] = get_fp_val(gb);
117 c[2] = get_fp_val(gb);
120 c[0] = get_fp_val(gb);
121 c[2] = get_fp_val(gb);
122 c[4] = get_fp_val(gb);
125 c[0] = get_fp_val(gb);
126 c[1] = get_fp_val(gb);
127 c[2] = get_fp_val(gb);
128 c[3] = get_fp_val(gb);
129 c[4] = get_fp_val(gb);
132 c[5] = get_fp_val(gb);
134 c[6] = get_fp_val(gb);
144 for (sprite = 0; sprite <= v->
two_sprites; sprite++) {
145 vc1_sprite_parse_transform(gb, sd->coefs[sprite]);
146 if (sd->coefs[sprite][1] || sd->coefs[sprite][3])
149 for (
i = 0;
i < 7;
i++)
151 sd->coefs[sprite][
i] / (1<<16),
152 (
abs(sd->coefs[sprite][
i]) & 0xFFFF) * 1000 / (1 << 16));
158 switch (sd->effect_pcount1 =
get_bits(gb, 4)) {
160 vc1_sprite_parse_transform(gb, sd->effect_params1);
163 vc1_sprite_parse_transform(gb, sd->effect_params1);
164 vc1_sprite_parse_transform(gb, sd->effect_params1 + 7);
167 for (
i = 0;
i < sd->effect_pcount1;
i++)
168 sd->effect_params1[
i] = get_fp_val(gb);
170 if (sd->effect_type != 13 || sd->effect_params1[0] != sd->coefs[0][6]) {
173 for (
i = 0;
i < sd->effect_pcount1;
i++)
175 sd->effect_params1[
i] / (1 << 16),
176 (
abs(sd->effect_params1[
i]) & 0xFFFF) * 1000 / (1 << 16));
180 sd->effect_pcount2 =
get_bits(gb, 16);
181 if (sd->effect_pcount2 > 10) {
184 }
else if (sd->effect_pcount2) {
188 sd->effect_params2[
i] = get_fp_val(gb);
190 sd->effect_params2[
i] / (1 << 16),
191 (
abs(sd->effect_params2[
i]) & 0xFFFF) * 1000 / (1 << 16));
210static void vc1_draw_sprites(
VC1Context *v, SpriteData* sd)
212 int i, plane, row, sprite;
213 int sr_cache[2][2] = { { -1, -1 }, { -1, -1 } };
214 const uint8_t *src_h[2][2];
215 int xoff[2], xadv[2], yoff[2], yadv[2],
alpha;
221 xadv[
i] = sd->coefs[
i][0];
230 for (plane = 0; plane < (CONFIG_GRAY &&
s->avctx->flags &
AV_CODEC_FLAG_GRAY ? 1 : 3); plane++) {
237 for (sprite = 0; sprite <= v->
two_sprites; sprite++) {
238 const uint8_t *iplane =
s->cur_pic.data[plane];
239 int iline =
s->cur_pic.linesize[plane];
240 int ycoord = yoff[sprite] + yadv[sprite] * row;
241 int yline = ycoord >> 16;
243 ysub[sprite] = ycoord & 0xFFFF;
245 iplane =
s->last_pic.data[plane];
246 iline =
s->last_pic.linesize[plane];
249 if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) {
250 src_h[sprite][0] = iplane + (xoff[sprite] >> 16) + yline * iline;
252 src_h[sprite][1] = iplane + (xoff[sprite] >> 16) + next_line;
254 if (sr_cache[sprite][0] != yline) {
255 if (sr_cache[sprite][1] == yline) {
257 FFSWAP(
int, sr_cache[sprite][0], sr_cache[sprite][1]);
260 sr_cache[sprite][0] = yline;
263 if (ysub[sprite] && sr_cache[sprite][1] != yline + 1) {
265 iplane + next_line, xoff[sprite],
266 xadv[sprite],
width);
267 sr_cache[sprite][1] = yline + 1;
269 src_h[sprite][0] = v->
sr_rows[sprite][0];
270 src_h[sprite][1] = v->
sr_rows[sprite][1];
281 if (ysub[0] && ysub[1]) {
283 src_h[1][0], src_h[1][1], ysub[1],
alpha,
width);
284 }
else if (ysub[0]) {
287 }
else if (ysub[1]) {
314 memset(&sd, 0,
sizeof(sd));
316 ret = vc1_parse_sprites(v, gb, &sd);
320 if (!
s->cur_pic.data[0]) {
325 if (v->
two_sprites && (!
s->last_pic.ptr || !
s->last_pic.data[0])) {
334 vc1_draw_sprites(v, &sd);
351 for (plane = 0; plane < (CONFIG_GRAY &&
s->avctx->flags &
AV_CODEC_FLAG_GRAY ? 1 : 3); plane++)
353 memset(
f->data[plane] +
i *
f->linesize[plane],
354 plane ? 128 : 0,
f->linesize[plane]);
363 int mb_height =
FFALIGN(
s->mb_height, 2);
406 v->
mv_f_base =
av_mallocz(2 * (
s->b8_stride * (mb_height * 2 + 1) +
s->mb_stride * (mb_height + 1) * 2));
410 v->
mv_f[1] = v->
mv_f[0] + (
s->b8_stride * (mb_height * 2 + 1) +
s->mb_stride * (mb_height + 1) * 2);
415 v->
mv_f_next[1] = v->
mv_f_next[0] + (
s->b8_stride * (mb_height * 2 + 1) +
s->mb_stride * (mb_height + 1) * 2);
418 for (
i = 0;
i < 4;
i++)
424 s->mb_width,
s->mb_height);
482 for (
i = 0;
i < 64;
i++) {
483#define transpose(x) (((x) >> 3) | (((x) & 7) << 3))
496 static VLCElem vlc_table[32372];
508 for (
int i = 0;
i < 3;
i++) {
522 for (
int i = 0;
i < 4;
i++) {
556 for (
int i = 0;
i < 8;
i++) {
602 s->msmpeg4_version = MSMP4_VC1;
658 }
else if (count < 0) {
666 uint8_t *buf2 =
NULL;
667 int seq_initialized = 0, ep_initialized = 0;
680 for (; next < end; start = next) {
682 size = next - start - 4;
709 if (!seq_initialized || !ep_initialized) {
781 for (
i = 0;
i < 4;
i++)
818 const uint8_t *buf = avpkt->
data;
819 int buf_size = avpkt->
size, n_slices = 0,
i, ret;
822 uint8_t *buf2 =
NULL;
823 const uint8_t *buf_start = buf, *buf_start_second_field =
NULL;
824 int mb_height, n_slices1=-1;
829 const uint8_t *rawbuf;
832 unsigned slices_allocated = 0;
845 if (
s->low_delay == 0 &&
s->next_pic.ptr) {
859 size_t next_allocated = 0;
865 const uint8_t *start, *end, *next;
869 for (start = buf, end = buf + buf_size; next < end; start = next) {
871 size = next - start - 4;
872 if (
size <= 0)
continue;
880 buf_start_second_field = start;
881 av_size_mult(
sizeof(*slices), n_slices+1, &next_allocated);
889 if (!slices[n_slices].buf) {
894 slices[n_slices].buf);
895 ret =
init_get_bits8(&slices[n_slices].gb, slices[n_slices].buf, buf_size3);
898 slices[n_slices].mby_start = avctx->
coded_height + 31 >> 5;
899 slices[n_slices].rawbuf = start;
900 slices[n_slices].raw_size =
size + 4;
901 n_slices1 = n_slices - 1;
914 av_size_mult(
sizeof(*slices), n_slices+1, &next_allocated);
922 if (!slices[n_slices].buf) {
927 slices[n_slices].buf);
928 ret =
init_get_bits8(&slices[n_slices].gb, slices[n_slices].buf, buf_size3);
931 slices[n_slices].mby_start =
get_bits(&slices[n_slices].gb, 9);
932 slices[n_slices].rawbuf = start;
933 slices[n_slices].raw_size =
size + 4;
939 }
else if (v->
interlace && ((buf[0] & 0xC0) == 0xC0)) {
940 const uint8_t *divider;
949 buf_start_second_field = divider;
950 av_size_mult(
sizeof(*slices), n_slices+1, &next_allocated);
958 if (!slices[n_slices].buf) {
963 ret =
init_get_bits8(&slices[n_slices].gb, slices[n_slices].buf, buf_size3);
966 slices[n_slices].mby_start =
s->mb_height + 1 >> 1;
967 slices[n_slices].rawbuf = divider;
968 slices[n_slices].raw_size = buf + buf_size - divider;
969 n_slices1 = n_slices - 1;
1003 if (
s->context_initialized &&
1009 if (!
s->context_initialized) {
1083 s->cur_pic.ptr->f->repeat_pict = 0;
1087 s->cur_pic.ptr->f->repeat_pict = 1;
1090 s->cur_pic.ptr->f->repeat_pict = v->
rptfrm * 2;
1096 if (v->
field_mode && buf_start_second_field) {
1099 ret =
hwaccel->start_frame(avctx, avpkt->
buf, buf_start,
1100 buf_start_second_field - buf_start);
1104 if (n_slices1 == -1) {
1106 ret =
hwaccel->decode_slice(avctx, buf_start,
1107 buf_start_second_field - buf_start);
1111 ret =
hwaccel->decode_slice(avctx, buf_start,
1112 slices[0].rawbuf - buf_start);
1116 for (
i = 0 ;
i < n_slices1 + 1;
i++) {
1117 v->
gb = slices[
i].gb;
1118 s->mb_y = slices[
i].mby_start;
1131 ret =
hwaccel->decode_slice(avctx, slices[
i].rawbuf,
1132 slices[
i].raw_size);
1138 if ((ret =
hwaccel->end_frame(avctx)) < 0)
1142 v->
gb = slices[n_slices1 + 1].gb;
1143 s->mb_y = slices[n_slices1 + 1].mby_start;
1154 ret =
hwaccel->start_frame(avctx, avpkt->
buf, buf_start_second_field,
1155 (buf + buf_size) - buf_start_second_field);
1159 if (n_slices - n_slices1 == 2) {
1161 ret =
hwaccel->decode_slice(avctx, buf_start_second_field,
1162 (buf + buf_size) - buf_start_second_field);
1166 ret =
hwaccel->decode_slice(avctx, buf_start_second_field,
1167 slices[n_slices1 + 2].rawbuf - buf_start_second_field);
1171 for (
i = n_slices1 + 2;
i < n_slices;
i++) {
1172 v->
gb = slices[
i].gb;
1173 s->mb_y = slices[
i].mby_start;
1186 ret =
hwaccel->decode_slice(avctx, slices[
i].rawbuf,
1187 slices[
i].raw_size);
1193 if ((ret =
hwaccel->end_frame(avctx)) < 0)
1197 ret =
hwaccel->start_frame(avctx, avpkt->
buf, buf_start,
1198 (buf + buf_size) - buf_start);
1202 if (n_slices == 0) {
1204 ret =
hwaccel->decode_slice(avctx, buf_start,
1205 (buf + buf_size) - buf_start);
1210 ret =
hwaccel->decode_slice(avctx, buf_start,
1211 slices[0].rawbuf - buf_start);
1216 for (
i = 0 ;
i < n_slices;
i++) {
1217 v->
gb = slices[
i].gb;
1218 s->mb_y = slices[
i].mby_start;
1231 ret =
hwaccel->decode_slice(avctx, slices[
i].rawbuf,
1232 slices[
i].raw_size);
1237 if ((ret =
hwaccel->end_frame(avctx)) < 0)
1247 s->cur_pic.linesize[0] <<= 1;
1248 s->cur_pic.linesize[1] <<= 1;
1249 s->cur_pic.linesize[2] <<= 1;
1251 s->uvlinesize <<= 1;
1257 for (
i = 0;
i <= n_slices;
i++) {
1258 if (
i > 0 && slices[
i - 1].mby_start >= mb_height) {
1261 "picture boundary (%d >= %d)\n",
i,
1262 slices[
i - 1].mby_start, mb_height);
1268 v->
mb_off =
s->mb_stride *
s->mb_height >> 1;
1297 s->start_mb_y = (
i == 0) ? 0 :
FFMAX(0, slices[
i-1].mby_start % mb_height);
1299 s->end_mb_y = (
i == n_slices ) ? mb_height :
FFMIN(mb_height, slices[
i].mby_start % mb_height);
1301 if (
i >= n_slices) {
1305 s->end_mb_y = (
i == n_slices1 + 1) ? mb_height :
FFMIN(mb_height, slices[
i].mby_start % mb_height);
1307 if (
s->end_mb_y <=
s->start_mb_y) {
1318 if (
i != n_slices) {
1319 v->
gb = slices[
i].gb;
1324 s->cur_pic.linesize[0] >>= 1;
1325 s->cur_pic.linesize[1] >>= 1;
1326 s->cur_pic.linesize[2] >>= 1;
1328 s->uvlinesize >>= 1;
1334 ff_dlog(
s->avctx,
"Consumed %i/%i bits\n",
1361#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
1362 if ((ret = vc1_decode_sprites(v, &v->
gb)) < 0)
1374 }
else if (
s->last_pic.ptr) {
1386 for (
i = 0;
i < n_slices;
i++)
1405#if CONFIG_VC1_DXVA2_HWACCEL
1408#if CONFIG_VC1_D3D11VA_HWACCEL
1411#if CONFIG_VC1_D3D11VA2_HWACCEL
1414#if CONFIG_VC1_D3D12VA_HWACCEL
1417#if CONFIG_VC1_NVDEC_HWACCEL
1420#if CONFIG_VC1_NVDEC_CUARRAY_HWACCEL
1423#if CONFIG_VC1_VAAPI_HWACCEL
1426#if CONFIG_VC1_VDPAU_HWACCEL
1434#if CONFIG_WMV3_DECODER
1447#if CONFIG_WMV3_DXVA2_HWACCEL
1450#if CONFIG_WMV3_D3D11VA_HWACCEL
1453#if CONFIG_WMV3_D3D11VA2_HWACCEL
1456#if CONFIG_WMV3_D3D12VA_HWACCEL
1459#if CONFIG_WMV3_NVDEC_HWACCEL
1462#if CONFIG_WMV3_NVDEC_CUARRAY_HWACCEL
1465#if CONFIG_WMV3_VAAPI_HWACCEL
1468#if CONFIG_WMV3_VDPAU_HWACCEL
1477#if CONFIG_WMV3IMAGE_DECODER
1479 .p.name =
"wmv3image",
1488 .flush = vc1_sprite_flush,
1492#if CONFIG_VC1IMAGE_DECODER
1494 .p.name =
"vc1image",
1503 .flush = vc1_sprite_flush,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_vc1_decoder
const FFCodec ff_vc1image_decoder
const FFCodec ff_wmv3_decoder
const FFCodec ff_wmv3image_decoder
static av_cold void close(AVCodecParserContext *s)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
#define FF_DEBUG_PICT_INFO
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Select the (possibly hardware accelerated) pixel format.
#define AV_EF_EXPLODE
abort decoding on minor error detection
int(* init)(AVBSFContext *ctx)
void ff_er_frame_end(ERContext *s, int *decode_error_flags)
Indicate that a frame has finished decoding and perform error concealment in case it has been enabled...
static struct @346255127015250356166251341105367306144006377143 state
static const char * hwaccel
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define AV_CODEC_FLAG_LOW_DELAY
Force low delay.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
@ AVDISCARD_ALL
discard all
@ AVDISCARD_NONKEY
discard all frames except keyframes
@ AVDISCARD_NONREF
discard all non reference
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
int av_size_mult(size_t a, size_t b, size_t *r)
Multiply two size_t values checking for overflow.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_BI
BI type.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
static const FFHWAccel * ffhwaccel(const AVHWAccel *codec)
#define HWACCEL_NVDEC_CUARRAY(codec)
#define HWACCEL_DXVA2(codec)
#define HWACCEL_VDPAU(codec)
#define HWACCEL_D3D12VA(codec)
#define HWACCEL_NVDEC(codec)
#define HWACCEL_VAAPI(codec)
#define HWACCEL_D3D11VA(codec)
#define HWACCEL_D3D11VA2(codec)
static const int16_t alpha[]
av_cold int ff_intrax8_common_init(AVCodecContext *avctx, IntraX8Context *w, int16_t block[64], int mb_width, int mb_height)
Initialize IntraX8 frame decoder.
av_cold void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
av_cold void ff_blockdsp_init(BlockDSPContext *c)
av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
av_cold void ff_qpeldsp_init(QpelDSPContext *c)
av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
Close a MSS2/VC1/WMV3 decoder.
static av_cold int vc1_decode_init(AVCodecContext *avctx)
Initialize a VC1/WMV3 decoder.
static av_cold void vc1_init_static(void)
static void vc1_decode_reset(AVCodecContext *avctx)
static enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[]
static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt)
Decode a VC1/WMV3 frame.
static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx)
static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
av_cold void ff_vc1_init_common(VC1Context *v)
Init VC-1 specific tables and VC1Context members.
av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
av_cold void ff_vc1dsp_init(VC1DSPContext *dsp)
Macro definitions for various function/variable attributes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int ff_thread_once(char *control, void(*routine)(void))
#define FFSWAP(type, a, b)
Memory handling functions.
void ff_mpeg_er_frame_start(MpegEncContext *s)
void ff_mpv_unref_picture(MPVWorkPicture *pic)
#define PICT_BOTTOM_FIELD
av_cold int ff_mpv_common_init(MpegEncContext *s)
init common structure for both encoder and decoder.
av_cold void ff_mpv_common_end(MpegEncContext *s)
int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
generic function called after decoding the header and before a frame is decoded.
av_cold void ff_mpeg_flush(AVCodecContext *avctx)
void ff_mpv_frame_end(MpegEncContext *s)
void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict)
av_cold int ff_mpv_decode_close(AVCodecContext *avctx)
av_cold int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx)
Initialize the given MpegEncContext for decoding.
mpegvideo decoder header.
av_cold void ff_msmp4_vc1_vlcs_init_once(void)
const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
@ AV_PIX_FMT_D3D11VA_VLD
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
@ AV_PIX_FMT_VDPAU
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
const AVProfile ff_vc1_profiles[]
void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
void ff_simple_idct_int16_8bit(int16_t *block)
void ff_simple_idct_add_int16_8bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int level
Encoding level descriptor.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
int flags
AV_CODEC_FLAG_*.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
int coded_width
Bitstream width / height, may be different from width/height e.g.
enum AVDiscard skip_frame
Skip decoding for selected frames.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int field_picture
whether or not the picture was encoded in separate fields
MPVPicture * ptr
RefStruct reference.
struct AVCodecContext * avctx
MPVWorkPicture next_pic
copy of the next picture structure.
MPVWorkPicture last_pic
copy of the previous picture structure.
enum AVPictureType pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int block_index[6]
index to current MB in block based arrays with edges
MPVWorkPicture cur_pic
copy of the current picture structure.
uint8_t * sr_rows[2][2]
Sprite resizer line cache.
int16_t(* luma_mv_base)[2]
int next_interlaced
whether last_pic, next_pic is interlaced
int transfer_char
8 bits, Opto-electronic transfer characteristics
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags.
int top_blk_sh
Either 3 or 0, positions of l/t in blk[].
uint8_t * over_flags_plane
Overflags bitplane.
uint8_t * direct_mb_plane
bitplane for "direct" MBs
int first_pic_header_flag
const VLCElem * cbpcy_vlc
CBPCY VLC table.
int new_sprite
Frame decoding info for sprite modes.
uint8_t zz_8x8[4][64]
Zigzag table for TT_8x8, permuted for IDCT.
int end_mb_x
Horizontal macroblock limit (used only by mss2)
H264ChromaContext h264chroma
int * ttblk
Transform type at the block level.
int res_fasttx
reserved, always 1
int field_mode
1 for interlaced field pictures
int res_sprite
Simple/Main Profile sequence header.
uint8_t * mv_type_mb_plane
bitplane for mv_type == (4MV)
int color_prim
8 bits, chroma coordinates of the color primaries
uint8_t * mv_f[2]
0: MV obtained from same field, 1: opposite field
uint8_t * acpred_plane
AC prediction flags bitplane.
uint8_t * blk_mv_type
0: frame MV, 1: field MV (interlaced frame)
int level
Advanced Profile.
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
int interlace
Progressive/interlaced (RPTFTM syntax element)
uint8_t * blk_mv_type_base
uint8_t * forward_mb_plane
bitplane for "forward" MBs
AVFrame * sprite_output_frame
int matrix_coef
8 bits, Color primaries->YCbCr transform matrix
void(* vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* sprite_v_single)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width)
void(* vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* sprite_v_double_onescale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1, const uint8_t *src2a, int alpha, int width)
void(* sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1, const uint8_t *src2a, const uint8_t *src2b, int offset2, int alpha, int width)
void(* sprite_v_double_noscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width)
void(* vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
int(* vc1_unescape_buffer)(const uint8_t *src, int size, uint8_t *dst)
void(* vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* vc1_inv_trans_8x8)(int16_t *b)
void(* vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void(* sprite_h)(uint8_t *dst, const uint8_t *src, int offset, int advance, int count)
For static VLCs, the number of bits can often be hardcoded at each get_vlc2() callsite.
#define avpriv_request_sample(...)
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb)
int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
Decode Simple/Main Profiles sequence header.
int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext *gb)
int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
int ff_vc1_decode_end(AVCodecContext *avctx)
Close a MSS2/VC1/WMV3 decoder.
void ff_vc1_decode_blocks(VC1Context *v)
@ PROGRESSIVE
in the bitstream is reported as 00b
static av_always_inline const uint8_t * find_next_marker(const uint8_t *src, const uint8_t *end)
Find VC-1 marker in buffer.
static const uint8_t vc1_if_mmv_mbmode_codes[8][8]
static const uint8_t vc1_2mv_block_pattern_bits[4][4]
static const uint8_t vc1_intfr_4mv_mbmode_bits[4][15]
static const uint8_t vc1_norm2_bits[4]
static const uint8_t vc1_2ref_mvdata_bits[8][126]
static const uint16_t vc1_cbpcy_p_codes[4][64]
static const uint8_t vc1_subblkpat_bits[3][15]
static const uint8_t vc1_ttmb_bits[3][16]
static const uint8_t vc1_intfr_non4mv_mbmode_bits[4][9]
static const uint8_t vc1_4mv_block_pattern_bits[4][16]
static const uint8_t vc1_subblkpat_codes[3][15]
static const uint8_t vc1_4mv_block_pattern_codes[4][16]
static const uint8_t vc1_if_1mv_mbmode_codes[8][6]
static const uint32_t vc1_1ref_mvdata_codes[4][72]
static const uint8_t vc1_norm6_bits[64]
static const uint16_t vc1_intfr_4mv_mbmode_codes[4][15]
static const uint8_t vc1_if_1mv_mbmode_bits[8][6]
static const uint32_t vc1_ac_tables[AC_MODES][186][2]
static const uint8_t vc1_1ref_mvdata_bits[4][72]
static const uint8_t vc1_ttblk_bits[3][8]
const int ff_vc1_ac_sizes[AC_MODES]
static const uint8_t vc1_intfr_non4mv_mbmode_codes[4][9]
static const uint16_t vc1_norm6_codes[64]
static const uint32_t vc1_2ref_mvdata_codes[8][126]
static const uint8_t vc1_imode_bits[7]
static const uint8_t vc1_if_mmv_mbmode_bits[8][8]
static const uint8_t vc1_norm2_codes[4]
static const uint8_t vc1_ttblk_codes[3][8]
static const uint16_t vc1_mv_diff_codes[4][73]
static const uint8_t vc1_mv_diff_bits[4][73]
static const uint8_t vc1_cbpcy_p_bits[4][64]
static const uint8_t vc1_2mv_block_pattern_codes[4][4]
static const uint8_t vc1_imode_codes[7]
static const uint8_t vc1_icbpcy_p_bits[8][63]
static const uint16_t vc1_icbpcy_p_codes[8][63]
static const uint16_t vc1_ttmb_codes[3][16]
const VLCElem * ff_vc1_2ref_mvdata_vlc[8]
const VLCElem * ff_vc1_ttblk_vlc[3]
const VLCElem * ff_vc1_icbpcy_vlc[8]
const VLCElem * ff_vc1_ac_coeff_table[8]
VLCElem ff_vc1_norm6_vlc[556]
VLCElem ff_vc1_imode_vlc[1<< VC1_IMODE_VLC_BITS]
const VLCElem * ff_vc1_subblkpat_vlc[3]
VLCElem ff_vc1_norm2_vlc[1<< VC1_NORM2_VLC_BITS]
const VLCElem * ff_vc1_ttmb_vlc[3]
const VLCElem * ff_vc1_if_1mv_mbmode_vlc[8]
const VLCElem * ff_vc1_if_mmv_mbmode_vlc[8]
const VLCElem * ff_vc1_intfr_4mv_mbmode_vlc[4]
const uint8_t ff_vc1_adv_interlaced_8x8_zz[64]
const VLCElem * ff_vc1_intfr_non4mv_mbmode_vlc[4]
const VLCElem * ff_vc1_2mv_block_pattern_vlc[4]
const VLCElem * ff_vc1_1ref_mvdata_vlc[4]
const VLCElem * ff_vc1_4mv_block_pattern_vlc[4]
const VLCElem * ff_vc1_cbpcy_p_vlc[4]
const VLCElem * ff_vc1_mv_diff_vlc[4]
#define VC1_NORM6_VLC_BITS
#define VC1_4MV_BLOCK_PATTERN_VLC_BITS
#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS
#define VC1_IMODE_VLC_BITS
#define VC1_1REF_MVDATA_VLC_BITS
#define VC1_INTFR_4MV_MBMODE_VLC_BITS
#define VC1_SUBBLKPAT_VLC_BITS
#define VC1_CBPCY_P_VLC_BITS
#define VC1_IF_1MV_MBMODE_VLC_BITS
#define VC1_TTMB_VLC_BITS
#define VC1_2MV_BLOCK_PATTERN_VLC_BITS
#define VC1_2REF_MVDATA_VLC_BITS
#define VC1_TTBLK_VLC_BITS
#define VC1_ICBPCY_VLC_BITS
#define VC1_IF_MMV_MBMODE_VLC_BITS
#define VC1_NORM2_VLC_BITS
#define VC1_MV_DIFF_VLC_BITS
#define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
#define VLC_INIT_STATE(_table)
static const VLCElem * ff_vlc_init_tables(VLCInitState *state, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, int flags)