31 #include "config_components.h"
65 const uint8_t *buf = avpkt->
data;
66 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;
85 int rawsize =
s->height *
FFALIGN(
s->width,2) * 2;
96 if (buf_size == 48 +
s->height * (
s->width * 3 / 4)) {
98 }
else if(buf_size == rawsize ) {
102 buf_size, 48 +
s->height * (
s->width * 3 / 4));
112 y_plane =
frame->data[0];
113 u_plane =
frame->data[1];
114 v_plane =
frame->data[2];
116 if (buf_size == rawsize) {
117 int linesize =
FFALIGN(
s->width,2) * 2;
118 y_plane +=
frame->linesize[0] *
s->height;
119 for (stream_ptr = 0; stream_ptr < rawsize; stream_ptr += linesize) {
120 y_plane -=
frame->linesize[0];
121 memcpy(y_plane, buf+stream_ptr, linesize);
126 for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
127 y_ptr < (
s->height *
frame->linesize[0]);
128 y_ptr +=
frame->linesize[0] -
s->width,
129 u_ptr +=
frame->linesize[1] -
s->width / 4,
130 v_ptr +=
frame->linesize[2] -
s->width / 4) {
133 cur_byte = buf[stream_ptr++];
134 u_plane[u_ptr++] = u_pred = cur_byte & 0xF0;
135 y_plane[y_ptr++] = y_pred = (cur_byte & 0x0F) << 4;
137 cur_byte = buf[stream_ptr++];
138 v_plane[v_ptr++] = v_pred = cur_byte & 0xF0;
139 y_pred += y_table[cur_byte & 0x0F];
140 y_plane[y_ptr++] = y_pred;
142 cur_byte = buf[stream_ptr++];
143 y_pred += y_table[cur_byte & 0x0F];
144 y_plane[y_ptr++] = y_pred;
145 y_pred += y_table[(cur_byte & 0xF0) >> 4];
146 y_plane[y_ptr++] = y_pred;
149 pixel_groups =
s->width / 4 - 1;
150 while (pixel_groups--) {
152 cur_byte = buf[stream_ptr++];
153 u_pred += u_table[(cur_byte & 0xF0) >> 4];
154 u_plane[u_ptr++] = u_pred;
155 y_pred += y_table[cur_byte & 0x0F];
156 y_plane[y_ptr++] = y_pred;
158 cur_byte = buf[stream_ptr++];
159 v_pred += v_table[(cur_byte & 0xF0) >> 4];
160 v_plane[v_ptr++] = v_pred;
161 y_pred += y_table[cur_byte & 0x0F];
162 y_plane[y_ptr++] = y_pred;
164 cur_byte = buf[stream_ptr++];
165 y_pred += y_table[cur_byte & 0x0F];
166 y_plane[y_ptr++] = y_pred;
167 y_pred += y_table[(cur_byte & 0xF0) >> 4];
168 y_plane[y_ptr++] = y_pred;
179 #if CONFIG_AURA_DECODER
193 #if CONFIG_CYUV_DECODER