74 if (partial_bit_count > 0) {
76 re_index -= partial_bit_count;
96 if (re_index + vlc_len > last_index) {
100 re_index = last_index;
105 av_dlog(NULL,
"run=%d level=%d\n", run, level);
111 block[scan_table[pos]] =
level;
136 int quant,
dc, dct_mode, class1, j;
137 int mb_index, mb_x, mb_y, last_index;
138 int y_stride, linesize;
150 int is_field_mode[5];
155 memset(sblock, 0, 5*
DV_MAX_BPM*
sizeof(*sblock));
159 block1 = &sblock[0][0];
162 for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->
sys->
bpm, block1 += s->
sys->
bpm * 64) {
164 quant = buf_ptr[3] & 0x0f;
169 is_field_mode[mb_index] = 0;
170 for (j = 0; j < s->
sys->
bpm; j++) {
182 is_field_mode[mb_index] |= !j && dct_mode;
194 buf_ptr += last_index >> 3;
198 av_dlog(avctx,
"MB block: %d, %d ", mb_index, j);
217 for (j = 0; j < s->
sys->
bpm; j++, block += 64, mb++) {
233 block = &sblock[0][0];
238 for (mb_index = 0; mb_index < 5; mb_index++) {
239 for (j = 0; j < s->
sys->
bpm; j++) {
241 av_dlog(avctx,
"start %d:%d\n", mb_index, j);
244 if (mb->
pos >= 64 && mb->
pos < 127)
252 block = &sblock[0][0];
254 for (mb_index = 0; mb_index < 5; mb_index++) {
260 (s->
sys->
height >= 720 && mb_y != 134)) {
261 y_stride = (s->
picture.
linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));
263 y_stride = (2 << log2_blocksize);
267 mb[0] .
idct_put(y_ptr , linesize, block + 0*64);
269 mb[2].
idct_put(y_ptr + (1 << log2_blocksize) , linesize, block + 2*64);
271 mb[1].
idct_put(y_ptr + (1 << log2_blocksize) , linesize, block + 1*64);
272 mb[2].
idct_put(y_ptr + y_stride, linesize, block + 2*64);
273 mb[3].
idct_put(y_ptr + (1 << log2_blocksize) + y_stride, linesize, block + 3*64);
281 for (j = 2; j; j--) {
284 uint64_t aligned_pixels[64/8];
289 for (y = 0; y < (1 << log2_blocksize); y++, c_ptr += s->
picture.
linesize[j], pixels += 8) {
290 ptr1 = pixels + ((1 << (log2_blocksize))>>1);
292 for (x = 0; x < (1 <<
FFMAX(log2_blocksize - 1, 0)); x++) {
293 c_ptr[x] = pixels[x];
299 y_stride = (mb_y == 134) ? (1 << log2_blocksize) :
300 s->
picture.
linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);
302 (mb++)->
idct_put(c_ptr , linesize, block); block += 64;
304 (mb++)->
idct_put(c_ptr + y_stride, linesize, block); block += 64;
315 void *
data,
int *got_frame,
319 int buf_size = avpkt->
size;
322 int ret, apt, is16_9;
341 vsc_pack = buf + 80*5 + 48 + 5;
344 is16_9 = (vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07);