53 if (avctx->
width & 7) {
75 int buf_size = avpkt->
size;
79 const uint8_t *bytestream = buf;
96 for (i = 0; i < 16; i++) {
97 a->
delta[i] = *bytestream++;
102 for (y = 0; y < avctx->
height; y++) {
110 if (buf_size < 4 + avctx->
width)
113 for (i = 0; i < 4; i++)
114 a->
offset[i] = *bytestream++;
117 offset = a->
offset[0] - a->
delta[bytestream[2] & 0xF];
118 for (x = 0; x < avctx->
width; x += 4) {
119 luma[0] = offset += a->
delta[bytestream[2] & 0xF];
120 luma[1] = offset += a->
delta[bytestream[2] >> 4];
121 luma[2] = offset += a->
delta[bytestream[0] & 0xF];
122 luma[3] = offset += a->
delta[bytestream[0] >> 4];
125 *cb++ = bytestream[3];
126 *cr++ = bytestream[1];
132 if (buf_size < avctx->
width / 2)
135 offset = a->
offset[y & 3] - a->
delta[bytestream[2] & 0xF];
137 for (x = 0; x < avctx->
width; x += 8) {
138 luma[0] = offset += a->
delta[bytestream[2] & 0xF];
139 luma[1] = offset += a->
delta[bytestream[2] >> 4];
140 luma[2] = offset += a->
delta[bytestream[3] & 0xF];
141 luma[3] = offset += a->
delta[bytestream[3] >> 4];
142 luma[4] = offset += a->
delta[bytestream[0] & 0xF];
143 luma[5] = offset += a->
delta[bytestream[0] >> 4];
144 luma[6] = offset += a->
delta[bytestream[1] & 0xF];
145 luma[7] = offset += a->
delta[bytestream[1] >> 4];
175 #undef CONFIG_VCR1_ENCODER
176 #define CONFIG_VCR1_ENCODER 0
178 #if CONFIG_VCR1_ENCODER
182 static int vcr1_encode_frame(
AVCodecContext *avctx,
unsigned char *buf,
183 int buf_size,
void *
data)
208 .encode = vcr1_encode_frame,
This structure describes decoded (raw) audio or video data.
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
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
static av_cold int vcr1_decode_init(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int init(AVCodecParserContext *s)
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 int put_bits_count(PutBitContext *s)
struct VCR1Context VCR1Context
common internal API header
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define AVERROR_INVALIDDATA
static int vcr1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int vcr1_common_init(AVCodecContext *avctx)
int key_frame
1 -> keyframe, 0-> not
static av_cold int vcr1_decode_end(AVCodecContext *avctx)
This structure stores compressed data.