54 const uint8_t *bytestream = avpkt->
data;
55 const uint8_t *bytestream_end = bytestream + avpkt->
size;
66 for (
i = 0;
i < 16;
i++) {
67 a->delta[
i] = *bytestream++;
71 for (y = 0; y < avctx->
height; y++) {
73 uint8_t *luma = &p->data[0][y * p->linesize[0]];
76 uint8_t *
cb = &p->data[1][(y >> 2) * p->linesize[1]];
77 uint8_t *
cr = &p->data[2][(y >> 2) * p->linesize[2]];
81 for (
i = 0;
i < 4;
i++)
82 a->offset[
i] = *bytestream++;
84 offset =
a->offset[0] -
a->delta[bytestream[2] & 0xF];
85 for (x = 0; x < avctx->
width; x += 4) {
86 luma[0] =
offset +=
a->delta[bytestream[2] & 0xF];
87 luma[1] =
offset +=
a->delta[bytestream[2] >> 4];
88 luma[2] =
offset +=
a->delta[bytestream[0] & 0xF];
89 luma[3] =
offset +=
a->delta[bytestream[0] >> 4];
92 *
cb++ = bytestream[3];
93 *
cr++ = bytestream[1];
100 offset =
a->offset[y & 3] -
a->delta[bytestream[2] & 0xF];
102 for (x = 0; x < avctx->
width; x += 8) {
103 luma[0] =
offset +=
a->delta[bytestream[2] & 0xF];
104 luma[1] =
offset +=
a->delta[bytestream[2] >> 4];
105 luma[2] =
offset +=
a->delta[bytestream[3] & 0xF];
106 luma[3] =
offset +=
a->delta[bytestream[3] >> 4];
107 luma[4] =
offset +=
a->delta[bytestream[0] & 0xF];
108 luma[5] =
offset +=
a->delta[bytestream[0] >> 4];
109 luma[6] =
offset +=
a->delta[bytestream[1] & 0xF];
110 luma[7] =
offset +=
a->delta[bytestream[1] >> 4];
119 return bytestream - avpkt->
data;
const FFCodec ff_vcr1_decoder
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 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(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
common internal API header
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
#define avpriv_request_sample(...)
static int vcr1_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
static av_cold int vcr1_decode_init(AVCodecContext *avctx)
static double cr(void *priv, double x, double y)
static double cb(void *priv, double x, double y)