61 void *
data,
int *got_frame,
65 int buf_size = avpkt->
size;
69 unsigned char *y_plane;
70 unsigned char *u_plane;
71 unsigned char *v_plane;
77 const signed char *y_table = (
const signed char*)buf + 0;
78 const signed char *u_table = (
const signed char*)buf + 16;
79 const signed char *v_table = (
const signed char*)buf + 32;
81 unsigned char y_pred, u_pred, v_pred;
83 unsigned char cur_byte;
95 if (buf_size != 48 + s->
height * (s->
width * 3 / 4)) {
109 y_plane = frame->
data[0];
110 u_plane = frame->
data[1];
111 v_plane = frame->
data[2];
114 for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
121 cur_byte = buf[stream_ptr++];
122 u_plane[u_ptr++] = u_pred = cur_byte & 0xF0;
123 y_plane[y_ptr++] = y_pred = (cur_byte & 0x0F) << 4;
125 cur_byte = buf[stream_ptr++];
126 v_plane[v_ptr++] = v_pred = cur_byte & 0xF0;
127 y_pred += y_table[cur_byte & 0x0F];
128 y_plane[y_ptr++] = y_pred;
130 cur_byte = buf[stream_ptr++];
131 y_pred += y_table[cur_byte & 0x0F];
132 y_plane[y_ptr++] = y_pred;
133 y_pred += y_table[(cur_byte & 0xF0) >> 4];
134 y_plane[y_ptr++] = y_pred;
137 pixel_groups = s->
width / 4 - 1;
138 while (pixel_groups--) {
140 cur_byte = buf[stream_ptr++];
141 u_pred += u_table[(cur_byte & 0xF0) >> 4];
142 u_plane[u_ptr++] = u_pred;
143 y_pred += y_table[cur_byte & 0x0F];
144 y_plane[y_ptr++] = y_pred;
146 cur_byte = buf[stream_ptr++];
147 v_pred += v_table[(cur_byte & 0xF0) >> 4];
148 v_plane[v_ptr++] = v_pred;
149 y_pred += y_table[cur_byte & 0x0F];
150 y_plane[y_ptr++] = y_pred;
152 cur_byte = buf[stream_ptr++];
153 y_pred += y_table[cur_byte & 0x0F];
154 y_plane[y_ptr++] = y_pred;
155 y_pred += y_table[(cur_byte & 0xF0) >> 4];
156 y_plane[y_ptr++] = y_pred;
166 #if CONFIG_AURA_DECODER
179 #if CONFIG_CYUV_DECODER
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int cyuv_decode_init(AVCodecContext *avctx)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
common internal API header
int width
picture width / height.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
static int cyuv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int init(AVCodecParserContext *s)
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.