61 void *
data,
int *data_size,
64 const uint8_t *buf = avpkt->
data;
65 int buf_size = avpkt->
size;
68 unsigned char *y_plane;
69 unsigned char *u_plane;
70 unsigned char *v_plane;
76 const signed char *y_table = (
const signed char*)buf + 0;
77 const signed char *u_table = (
const signed char*)buf + 16;
78 const signed char *v_table = (
const signed char*)buf + 32;
80 unsigned char y_pred, u_pred, v_pred;
82 unsigned char cur_byte;
93 if (buf_size != 48 + s->
height * (s->
width * 3 / 4)) {
117 for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
124 cur_byte = buf[stream_ptr++];
125 u_plane[u_ptr++] = u_pred = cur_byte & 0xF0;
126 y_plane[y_ptr++] = y_pred = (cur_byte & 0x0F) << 4;
128 cur_byte = buf[stream_ptr++];
129 v_plane[v_ptr++] = v_pred = cur_byte & 0xF0;
130 y_pred += y_table[cur_byte & 0x0F];
131 y_plane[y_ptr++] = y_pred;
133 cur_byte = buf[stream_ptr++];
134 y_pred += y_table[cur_byte & 0x0F];
135 y_plane[y_ptr++] = y_pred;
136 y_pred += y_table[(cur_byte & 0xF0) >> 4];
137 y_plane[y_ptr++] = y_pred;
140 pixel_groups = s->
width / 4 - 1;
141 while (pixel_groups--) {
143 cur_byte = buf[stream_ptr++];
144 u_pred += u_table[(cur_byte & 0xF0) >> 4];
145 u_plane[u_ptr++] = u_pred;
146 y_pred += y_table[cur_byte & 0x0F];
147 y_plane[y_ptr++] = y_pred;
149 cur_byte = buf[stream_ptr++];
150 v_pred += v_table[(cur_byte & 0xF0) >> 4];
151 v_plane[v_ptr++] = v_pred;
152 y_pred += y_table[cur_byte & 0x0F];
153 y_plane[y_ptr++] = y_pred;
155 cur_byte = buf[stream_ptr++];
156 y_pred += y_table[cur_byte & 0x0F];
157 y_plane[y_ptr++] = y_pred;
158 y_pred += y_table[(cur_byte & 0xF0) >> 4];
159 y_plane[y_ptr++] = y_pred;
180 #if CONFIG_AURA_DECODER
194 #if CONFIG_CYUV_DECODER
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.
#define FF_BUFFER_HINTS_VALID
static int cyuv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
int buffer_hints
codec suggestion on buffer type if != 0
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
struct CyuvDecodeContext CyuvDecodeContext
static av_cold int cyuv_decode_init(AVCodecContext *avctx)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int init(AVCodecParserContext *s)
static av_cold int cyuv_decode_end(AVCodecContext *avctx)
#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.
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.
static void close(AVCodecParserContext *s)
#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.