70 memset(&idsp,0,
sizeof(idsp));
73 for (i = 0; i < 64; i++)
77 for (i = 0; i < 64; i++){
104 if (partial_bit_count > 0) {
105 re_cache = re_cache >> partial_bit_count |
107 re_index -= partial_bit_count;
127 if (re_index + vlc_len > last_index) {
131 re_index = last_index;
136 av_dlog(NULL,
"run=%d level=%d\n", run, level);
143 block[scan_table[pos]] =
level;
167 int quant,
dc, dct_mode, class1, j;
168 int mb_index, mb_x, mb_y, last_index;
169 int y_stride, linesize;
181 int is_field_mode[5];
186 memset(sblock, 0, 5 *
DV_MAX_BPM *
sizeof(*sblock));
190 block1 = &sblock[0][0];
193 for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->
sys->
bpm, block1 += s->
sys->
bpm * 64) {
195 quant = buf_ptr[3] & 0x0f;
200 is_field_mode[mb_index] = 0;
201 for (j = 0; j < s->
sys->
bpm; j++) {
215 is_field_mode[mb_index] |= !j && dct_mode;
229 buf_ptr += last_index >> 3;
233 av_dlog(avctx,
"MB block: %d, %d ", mb_index, j);
252 for (j = 0; j < s->
sys->
bpm; j++, block += 64, mb++) {
268 block = &sblock[0][0];
273 for (mb_index = 0; mb_index < 5; mb_index++) {
274 for (j = 0; j < s->
sys->
bpm; j++) {
276 av_dlog(avctx,
"start %d:%d\n", mb_index, j);
279 if (mb->
pos >= 64 && mb->
pos < 127)
281 "AC EOB marker is absent pos=%d\n", mb->
pos);
288 block = &sblock[0][0];
290 for (mb_index = 0; mb_index < 5; mb_index++) {
296 (s->
sys->
height >= 720 && mb_y != 134)) {
298 ((!is_field_mode[mb_index]) * log2_blocksize));
300 y_stride = (2 << log2_blocksize);
305 mb[0].
idct_put(y_ptr, linesize, block + 0 * 64);
307 mb[2].
idct_put(y_ptr + (1 << log2_blocksize), linesize, block + 2 * 64);
309 mb[1].
idct_put(y_ptr + (1 << log2_blocksize), linesize, block + 1 * 64);
310 mb[2].
idct_put(y_ptr + y_stride, linesize, block + 2 * 64);
311 mb[3].
idct_put(y_ptr + (1 << log2_blocksize) + y_stride, linesize, block + 3 * 64);
319 for (j = 2; j; j--) {
322 uint64_t aligned_pixels[64 / 8];
327 for (y = 0; y < (1 << log2_blocksize); y++, c_ptr += s->
frame->
linesize[j], pixels += 8) {
328 ptr1 = pixels + ((1 << (log2_blocksize))>>1);
330 for (x = 0; x < (1 <<
FFMAX(log2_blocksize - 1, 0)); x++) {
331 c_ptr[x] = pixels[x];
338 y_stride = (mb_y == 134) ? (1 << log2_blocksize) :
339 s->
frame->
linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);
341 (mb++)->
idct_put(c_ptr, linesize, block);
344 (mb++)->
idct_put(c_ptr + y_stride, linesize, block);
359 int buf_size = avpkt->
size;
362 int apt, is16_9,
ret;
391 vsc_pack = buf + 80 * 5 + 48 + 5;
394 is16_9 = (vsc_pack[2] & 0x07) == 0x02 ||
395 (!apt && (vsc_pack[2] & 0x07) == 0x07);