29 if (avctx->
width & 1) {
45 const uint8_t *buf = avpkt->
data;
46 const uint8_t *buf_end = buf + avpkt->
size;
55 if (bytestream_get_le32(&buf) !=
AV_RL32(
"FRW1")) {
69 for (field = 0; field < 2; field++) {
71 int field_h = (avctx->
height + !field) >> 1;
72 int field_size, min_field_size = avctx->
width * 2 * field_h;
73 uint8_t *dst = pic->
data[0];
74 if (buf_end - buf < 8)
77 field_size = bytestream_get_le32(&buf);
78 if (field_size < min_field_size) {
79 av_log(avctx,
AV_LOG_ERROR,
"Field size %i is too small (required %i)\n", field_size, min_field_size);
82 if (buf_end - buf < field_size) {
83 av_log(avctx,
AV_LOG_ERROR,
"Packet is too small, need %i, have %i\n", field_size, (
int)(buf_end - buf));
88 for (i = 0; i < field_h; i++) {
89 memcpy(dst, buf, avctx->
width * 2);
90 buf += avctx->
width * 2;
93 buf += field_size - min_field_size;
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
AVFrame * coded_frame
the picture in the bitstream
static av_cold int decode_close(AVCodecContext *avctx)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
int interlaced_frame
The content of the picture is interlaced.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static av_cold int decode_init(AVCodecContext *avctx)
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
int top_field_first
If the content is interlaced, is top field displayed first.
int key_frame
1 -> keyframe, 0-> not