77
80
MpegEncContext *s = &v->s;
78
81
ff_init_block_index(s);
79
82
if (v->field_mode && !(v->second_field ^ v->tff)) {
80
s->dest[0] += s->current_picture_ptr->f.linesize[0];
81
s->dest[1] += s->current_picture_ptr->f.linesize[1];
82
s->dest[2] += s->current_picture_ptr->f.linesize[2];
83
s->dest[0] += s->current_picture_ptr->f->linesize[0];
84
s->dest[1] += s->current_picture_ptr->f->linesize[1];
85
s->dest[2] += s->current_picture_ptr->f->linesize[2];
106
109
fieldtx = v->fieldtx_plane[topleft_mb_pos];
107
110
stride_y = s->linesize << fieldtx;
108
111
v_dist = (16 - fieldtx) >> (fieldtx == 0);
109
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
110
s->dest[0] - 16 * s->linesize - 16,
112
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],
113
s->dest[0] - 16 * s->linesize - 8,
115
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],
116
s->dest[0] - v_dist * s->linesize - 16,
118
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],
119
s->dest[0] - v_dist * s->linesize - 8,
121
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],
122
s->dest[1] - 8 * s->uvlinesize - 8,
124
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],
125
s->dest[2] - 8 * s->uvlinesize - 8,
112
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
113
s->dest[0] - 16 * s->linesize - 16,
115
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],
116
s->dest[0] - 16 * s->linesize - 8,
118
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],
119
s->dest[0] - v_dist * s->linesize - 16,
121
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],
122
s->dest[0] - v_dist * s->linesize - 8,
124
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],
125
s->dest[1] - 8 * s->uvlinesize - 8,
127
s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],
128
s->dest[2] - 8 * s->uvlinesize - 8,
128
131
if (s->mb_x == s->mb_width - 1) {
129
132
top_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x;
131
134
fieldtx = v->fieldtx_plane[top_mb_pos];
132
135
stride_y = s->linesize << fieldtx;
133
136
v_dist = fieldtx ? 15 : 8;
134
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],
135
s->dest[0] - 16 * s->linesize,
137
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],
138
s->dest[0] - 16 * s->linesize + 8,
140
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],
141
s->dest[0] - v_dist * s->linesize,
143
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],
144
s->dest[0] - v_dist * s->linesize + 8,
146
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],
147
s->dest[1] - 8 * s->uvlinesize,
149
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],
150
s->dest[2] - 8 * s->uvlinesize,
137
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],
138
s->dest[0] - 16 * s->linesize,
140
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],
141
s->dest[0] - 16 * s->linesize + 8,
143
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],
144
s->dest[0] - v_dist * s->linesize,
146
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],
147
s->dest[0] - v_dist * s->linesize + 8,
149
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],
150
s->dest[1] - 8 * s->uvlinesize,
152
s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],
153
s->dest[2] - 8 * s->uvlinesize,
386
389
if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
387
srcY = s->current_picture.f.data[0];
388
srcU = s->current_picture.f.data[1];
389
srcV = s->current_picture.f.data[2];
390
srcY = s->current_picture.f->data[0];
391
srcU = s->current_picture.f->data[1];
392
srcV = s->current_picture.f->data[2];
390
393
luty = v->curr_luty;
391
394
lutuv = v->curr_lutuv;
392
395
use_ic = v->curr_use_ic;
394
srcY = s->last_picture.f.data[0];
395
srcU = s->last_picture.f.data[1];
396
srcV = s->last_picture.f.data[2];
397
srcY = s->last_picture.f->data[0];
398
srcU = s->last_picture.f->data[1];
399
srcV = s->last_picture.f->data[2];
397
400
luty = v->last_luty;
398
401
lutuv = v->last_lutuv;
399
402
use_ic = v->last_use_ic;
402
srcY = s->next_picture.f.data[0];
403
srcU = s->next_picture.f.data[1];
404
srcV = s->next_picture.f.data[2];
405
srcY = s->next_picture.f->data[0];
406
srcU = s->next_picture.f->data[1];
407
srcV = s->next_picture.f->data[2];
405
408
luty = v->next_luty;
406
409
lutuv = v->next_lutuv;
407
410
use_ic = v->next_use_ic;
434
437
srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
436
439
if (v->field_mode && v->ref_field_type[dir]) {
437
srcY += s->current_picture_ptr->f.linesize[0];
438
srcU += s->current_picture_ptr->f.linesize[1];
439
srcV += s->current_picture_ptr->f.linesize[2];
440
srcY += s->current_picture_ptr->f->linesize[0];
441
srcU += s->current_picture_ptr->f->linesize[1];
442
srcV += s->current_picture_ptr->f->linesize[2];
442
445
/* for grayscale we should not try to read from unknown area */
581
584
if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) {
582
srcY = s->current_picture.f.data[0];
585
srcY = s->current_picture.f->data[0];
583
586
luty = v->curr_luty;
584
587
use_ic = v->curr_use_ic;
586
srcY = s->last_picture.f.data[0];
589
srcY = s->last_picture.f->data[0];
587
590
luty = v->last_luty;
588
591
use_ic = v->last_use_ic;
591
srcY = s->next_picture.f.data[0];
594
srcY = s->next_picture.f->data[0];
592
595
luty = v->next_luty;
593
596
use_ic = v->next_use_ic;
687
690
srcY += src_y * s->linesize + src_x;
688
691
if (v->field_mode && v->ref_field_type[dir])
689
srcY += s->current_picture_ptr->f.linesize[0];
692
srcY += s->current_picture_ptr->f->linesize[0];
691
694
if (fieldmv && !(src_y & 1))
848
851
chroma_ref_type = !v->cur_field_type;
850
if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f.data[0])
853
if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f->data[0])
852
855
s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx;
853
856
s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty;
880
883
if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) {
881
srcU = s->current_picture.f.data[1];
882
srcV = s->current_picture.f.data[2];
884
srcU = s->current_picture.f->data[1];
885
srcV = s->current_picture.f->data[2];
883
886
lutuv = v->curr_lutuv;
884
887
use_ic = v->curr_use_ic;
886
srcU = s->last_picture.f.data[1];
887
srcV = s->last_picture.f.data[2];
889
srcU = s->last_picture.f->data[1];
890
srcV = s->last_picture.f->data[2];
888
891
lutuv = v->last_lutuv;
889
892
use_ic = v->last_use_ic;
892
srcU = s->next_picture.f.data[1];
893
srcV = s->next_picture.f.data[2];
895
srcU = s->next_picture.f->data[1];
896
srcV = s->next_picture.f->data[2];
894
897
lutuv = v->next_lutuv;
895
898
use_ic = v->next_use_ic;
1011
1014
uvsrc_x = av_clip(uvsrc_x, -8, s->avctx->coded_width >> 1);
1012
1015
uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1);
1013
1016
if (i < 2 ? dir : dir2) {
1014
srcU = s->next_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
1015
srcV = s->next_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
1017
srcU = s->next_picture.f->data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
1018
srcV = s->next_picture.f->data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
1016
1019
lutuv = v->next_lutuv;
1017
1020
use_ic = v->next_use_ic;
1019
srcU = s->last_picture.f.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
1020
srcV = s->last_picture.f.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
1022
srcU = s->last_picture.f->data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
1023
srcV = s->last_picture.f->data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
1021
1024
lutuv = v->last_lutuv;
1022
1025
use_ic = v->last_use_ic;
1922
1926
uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
1923
1927
uvmy = uvmy + ((uvmy < 0) ? -(uvmy & 1) : (uvmy & 1));
1925
srcY = s->next_picture.f.data[0];
1926
srcU = s->next_picture.f.data[1];
1927
srcV = s->next_picture.f.data[2];
1929
srcY = s->next_picture.f->data[0];
1930
srcU = s->next_picture.f->data[1];
1931
srcV = s->next_picture.f->data[2];
1929
1933
src_x = s->mb_x * 16 + (mx >> 2);
1930
1934
src_y = s->mb_y * 16 + (my >> 2);
1948
1952
srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
1950
1954
if (v->field_mode && v->ref_field_type[1]) {
1951
srcY += s->current_picture_ptr->f.linesize[0];
1952
srcU += s->current_picture_ptr->f.linesize[1];
1953
srcV += s->current_picture_ptr->f.linesize[2];
1955
srcY += s->current_picture_ptr->f->linesize[0];
1956
srcU += s->current_picture_ptr->f->linesize[1];
1957
srcV += s->current_picture_ptr->f->linesize[2];
1956
1960
/* for grayscale we should not try to read from unknown area */
3276
3280
v->vc1dsp.vc1_inv_trans_8x8_dc(dst, linesize, block);
3278
3282
v->vc1dsp.vc1_inv_trans_8x8(block);
3279
s->dsp.add_pixels_clamped(block, dst, linesize);
3283
s->idsp.add_pixels_clamped(block, dst, linesize);
3607
3611
if (v->rangeredfrm)
3608
3612
for (j = 0; j < 64; j++)
3609
3613
s->block[i][j] <<= 1;
3610
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
3614
s->idsp.put_signed_pixels_clamped(s->block[i],
3615
s->dest[dst_idx] + off,
3616
i & 4 ? s->uvlinesize
3611
3618
if (v->pq >= 9 && v->overlap) {
3612
3619
if (v->c_avail)
3613
3620
v->vc1dsp.vc1_h_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
3715
3722
if (v->rangeredfrm)
3716
3723
for (j = 0; j < 64; j++)
3717
3724
s->block[i][j] <<= 1;
3718
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off,
3719
(i & 4) ? s->uvlinesize : s->linesize);
3725
s->idsp.put_signed_pixels_clamped(s->block[i],
3726
s->dest[dst_idx] + off,
3727
(i & 4) ? s->uvlinesize
3720
3729
if (v->pq >= 9 && v->overlap) {
3721
3730
if (v->c_avail)
3722
3731
v->vc1dsp.vc1_h_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
4028
4039
v->vc1dsp.vc1_inv_trans_8x8(s->block[i]);
4029
4040
off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
4030
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize);
4041
s->idsp.put_signed_pixels_clamped(s->block[i],
4042
s->dest[dst_idx] + off,
4043
(i & 4) ? s->uvlinesize
4031
4045
// TODO: loop filter
4229
4243
if (v->rangeredfrm)
4230
4244
for (j = 0; j < 64; j++)
4231
4245
s->block[i][j] <<= 1;
4232
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize);
4246
s->idsp.put_signed_pixels_clamped(s->block[i],
4247
s->dest[dst_idx] + off,
4248
i & 4 ? s->uvlinesize
4233
4250
} else if (val) {
4234
4251
vc1_decode_p_block(v, s->block[i], i, mquant, ttmb,
4235
4252
first_block, s->dest[dst_idx] + off,
4301
4318
for (j = 0; j < 64; j++)
4302
4319
s->block[i][j] <<= 1;
4303
4320
off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
4304
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize);
4321
s->idsp.put_signed_pixels_clamped(s->block[i],
4322
s->dest[dst_idx] + off,
4323
(i & 4) ? s->uvlinesize
4305
4325
// TODO: yet to perform loop filter
4520
4540
stride_y = s->uvlinesize;
4523
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, stride_y);
4543
s->idsp.put_signed_pixels_clamped(s->block[i],
4544
s->dest[dst_idx] + off,
4526
4548
s->mb_intra = v->is_intra[s->mb_x] = 0;
4794
4816
dst[3] = dst[2] + 8;
4795
4817
dst[4] = s->dest[1];
4796
4818
dst[5] = s->dest[2];
4797
s->dsp.clear_blocks(s->block[0]);
4819
s->bdsp.clear_blocks(s->block[0]);
4798
4820
mb_pos = s->mb_x + s->mb_y * s->mb_width;
4799
4821
s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
4800
4822
s->current_picture.qscale_table[mb_pos] = v->pq;
4824
4846
if (v->rangeredfrm)
4825
4847
for (j = 0; j < 64; j++)
4826
4848
s->block[k][j] <<= 1;
4827
s->dsp.put_signed_pixels_clamped(s->block[k], dst[k], k & 4 ? s->uvlinesize : s->linesize);
4849
s->idsp.put_signed_pixels_clamped(s->block[k], dst[k],
4850
k & 4 ? s->uvlinesize
4829
4853
if (v->rangeredfrm)
4830
4854
for (j = 0; j < 64; j++)
4831
4855
s->block[k][j] = (s->block[k][j] - 64) << 1;
4832
s->dsp.put_pixels_clamped(s->block[k], dst[k], k & 4 ? s->uvlinesize : s->linesize);
4856
s->idsp.put_pixels_clamped(s->block[k], dst[k],
4857
k & 4 ? s->uvlinesize
4934
4960
for (;s->mb_x < s->mb_width; s->mb_x++) {
4935
4961
int16_t (*block)[64] = v->block[v->cur_blk_idx];
4936
4962
ff_update_block_index(s);
4937
s->dsp.clear_blocks(block[0]);
4963
s->bdsp.clear_blocks(block[0]);
4938
4964
mb_pos = s->mb_x + s->mb_y * s->mb_stride;
4939
4965
s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA;
4940
4966
s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
5159
5185
MpegEncContext *s = &v->s;
5161
if (!v->s.last_picture.f.data[0])
5187
if (!v->s.last_picture.f->data[0])
5164
5190
ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END);
5168
5194
init_block_index(v);
5169
5195
ff_update_block_index(s);
5170
memcpy(s->dest[0], s->last_picture.f.data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16);
5171
memcpy(s->dest[1], s->last_picture.f.data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
5172
memcpy(s->dest[2], s->last_picture.f.data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
5196
memcpy(s->dest[0], s->last_picture.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16);
5197
memcpy(s->dest[1], s->last_picture.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
5198
memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
5173
5199
ff_mpeg_draw_horiz_band(s, s->mb_y * 16, 16);
5174
5200
s->first_slice_line = 0;
5368
5394
v->sprite_output_frame->linesize[plane] * row;
5370
5396
for (sprite = 0; sprite <= v->two_sprites; sprite++) {
5371
uint8_t *iplane = s->current_picture.f.data[plane];
5372
int iline = s->current_picture.f.linesize[plane];
5397
uint8_t *iplane = s->current_picture.f->data[plane];
5398
int iline = s->current_picture.f->linesize[plane];
5373
5399
int ycoord = yoff[sprite] + yadv[sprite] * row;
5374
5400
int yline = ycoord >> 16;
5376
5402
ysub[sprite] = ycoord & 0xFFFF;
5378
iplane = s->last_picture.f.data[plane];
5379
iline = s->last_picture.f.linesize[plane];
5404
iplane = s->last_picture.f->data[plane];
5405
iline = s->last_picture.f->linesize[plane];
5381
5407
next_line = FFMIN(yline + 1, (v->sprite_height >> !!plane) - 1) * iline;
5382
5408
if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) {
5446
5472
vc1_parse_sprites(v, gb, &sd);
5448
if (!s->current_picture.f.data[0]) {
5474
if (!s->current_picture.f->data[0]) {
5449
5475
av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
5453
if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f.data[0])) {
5479
if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) {
5454
5480
av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n");
5455
5481
v->two_sprites = 0;
5471
5497
VC1Context *v = avctx->priv_data;
5472
5498
MpegEncContext *s = &v->s;
5473
AVFrame *f = &s->current_picture.f;
5499
AVFrame *f = s->current_picture.f;
5476
5502
/* Windows Media Image codecs have a convergence interval of two keyframes.
5593
5619
if (!avctx->extradata_size || !avctx->extradata)
5595
5621
if (!(avctx->flags & CODEC_FLAG_GRAY))
5596
avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
5622
avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
5598
5624
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
5599
avctx->hwaccel = ff_find_hwaccel(avctx);
5600
5625
v->s.avctx = avctx;
5602
5627
if (ff_vc1_init_common(v) < 0)
5629
ff_blockdsp_init(&s->bdsp, avctx);
5604
5630
ff_h264chroma_init(&v->h264chroma, 8);
5605
ff_vc1dsp_init(&v->vc1dsp);
5631
ff_qpeldsp_init(&s->qdsp);
5607
5633
if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
5768
5794
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) {
5769
5795
/* special case for last picture */
5770
5796
if (s->low_delay == 0 && s->next_picture_ptr) {
5771
if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0)
5797
if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
5773
5799
s->next_picture_ptr = NULL;
5936
5962
// for skipping the frame
5937
s->current_picture.f.pict_type = s->pict_type;
5938
s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
5963
s->current_picture.f->pict_type = s->pict_type;
5964
s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
5940
5966
/* skip B-frames if we don't have reference frames */
5941
5967
if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) {
5944
5970
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
5945
5971
(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
5961
5987
// process pulldown flags
5962
s->current_picture_ptr->f.repeat_pict = 0;
5988
s->current_picture_ptr->f->repeat_pict = 0;
5963
5989
// Pulldown flags are only valid when 'broadcast' has been set.
5964
5990
// So ticks_per_frame will be 2
5966
5992
// repeat field
5967
s->current_picture_ptr->f.repeat_pict = 1;
5993
s->current_picture_ptr->f->repeat_pict = 1;
5968
5994
} else if (v->rptfrm) {
5969
5995
// repeat frames
5970
s->current_picture_ptr->f.repeat_pict = v->rptfrm * 2;
5996
s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2;
5973
s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
5974
s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
5999
s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
6000
s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
5976
6002
if (avctx->hwaccel) {
5977
6003
if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
5988
6014
v->bits = buf_size * 8;
5989
6015
v->end_mb_x = s->mb_width;
5990
6016
if (v->field_mode) {
5991
s->current_picture.f.linesize[0] <<= 1;
5992
s->current_picture.f.linesize[1] <<= 1;
5993
s->current_picture.f.linesize[2] <<= 1;
6017
s->current_picture.f->linesize[0] <<= 1;
6018
s->current_picture.f->linesize[1] <<= 1;
6019
s->current_picture.f->linesize[2] <<= 1;
5994
6020
s->linesize <<= 1;
5995
6021
s->uvlinesize <<= 1;
6050
6076
if (v->field_mode) {
6051
6077
v->second_field = 0;
6052
s->current_picture.f.linesize[0] >>= 1;
6053
s->current_picture.f.linesize[1] >>= 1;
6054
s->current_picture.f.linesize[2] >>= 1;
6078
s->current_picture.f->linesize[0] >>= 1;
6079
s->current_picture.f->linesize[1] >>= 1;
6080
s->current_picture.f->linesize[2] >>= 1;
6055
6081
s->linesize >>= 1;
6056
6082
s->uvlinesize >>= 1;
6057
6083
if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) {
6084
6110
*got_frame = 1;
6086
6112
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
6087
if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
6113
if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
6089
6115
ff_print_debug_info(s, s->current_picture_ptr);
6090
6116
*got_frame = 1;
6091
6117
} else if (s->last_picture_ptr != NULL) {
6092
if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
6118
if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
6094
6120
ff_print_debug_info(s, s->last_picture_ptr);
6095
6121
*got_frame = 1;
6178
6204
.decode = vc1_decode_frame,
6179
6205
.capabilities = CODEC_CAP_DR1,
6180
6206
.flush = vc1_sprite_flush,
6181
.pix_fmts = ff_pixfmt_list_420
6207
.pix_fmts = (const enum AVPixelFormat[]) {
6194
6223
.decode = vc1_decode_frame,
6195
6224
.capabilities = CODEC_CAP_DR1,
6196
6225
.flush = vc1_sprite_flush,
6197
.pix_fmts = ff_pixfmt_list_420
6226
.pix_fmts = (const enum AVPixelFormat[]) {