current_picture->cur_pic, last_picture->last_pic, similarly for new_picture and next_picture. Also rename the corresponding *_ptr fields.
Unified · Split
| @@ -44,7 +44,7 @@ static int d3d12va_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint · 43 unmodified lines | ||
| 44 | 44 | { |
| 45 | 45 | const MpegEncContext *s = avctx->priv_data; |
| 46 | 46 | D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); |
| 47 | − D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 47 | + D3D12DecodePictureContext *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 48 | 48 | |
| 49 | 49 | if (!ctx) |
| 50 | 50 | return -1; |
| @@ -69,7 +69,7 @@ static int d3d12va_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint · 18 unmodified lines | ||
| 69 | 69 | static int d3d12va_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) |
| 70 | 70 | { |
| 71 | 71 | const MpegEncContext *s = avctx->priv_data; |
| 72 | − D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 72 | + D3D12DecodePictureContext *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 73 | 73 | |
| 74 | 74 | if (ctx_pic->slice_count >= MAX_SLICES) { |
| 75 | 75 | return AVERROR(ERANGE); |
| @@ -88,7 +88,7 @@ static int d3d12va_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buff · 12 unmodified lines | ||
| 88 | 88 | static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer) |
| 89 | 89 | { |
| 90 | 90 | const MpegEncContext *s = avctx->priv_data; |
| 91 | − D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 91 | + D3D12DecodePictureContext *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 92 | 92 | |
| 93 | 93 | const int is_field = s->picture_structure != PICT_FRAME; |
| 94 | 94 | const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); |
| @@ -137,12 +137,12 @@ static int d3d12va_mpeg2_end_frame(AVCodecContext *avctx) · 42 unmodified lines | ||
| 137 | 137 | { |
| 138 | 138 | int ret; |
| 139 | 139 | MpegEncContext *s = avctx->priv_data; |
| 140 | − D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 140 | + D3D12DecodePictureContext *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 141 | 141 | |
| 142 | 142 | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) |
| 143 | 143 | return -1; |
| 144 | 144 | |
| 145 | − ret = ff_d3d12va_common_end_frame(avctx, s->current_picture_ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), | |
| 145 | + ret = ff_d3d12va_common_end_frame(avctx, s->cur_pic_ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), | |
| 146 | 146 | &ctx_pic->qm, sizeof(ctx_pic->qm), update_input_arguments); |
| 147 | 147 | if (!ret) |
| 148 | 148 | ff_mpeg_draw_horiz_band(s, 0, avctx->height); |
| @@ -45,7 +45,7 @@ static int d3d12va_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 44 unmodified lines | ||
| 45 | 45 | { |
| 46 | 46 | const VC1Context *v = avctx->priv_data; |
| 47 | 47 | D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx); |
| 48 | − D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |
| 48 | + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic_ptr->hwaccel_picture_private; | |
| 49 | 49 | |
| 50 | 50 | if (!ctx) |
| 51 | 51 | return -1; |
| @@ -67,7 +67,7 @@ static int d3d12va_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 15 unmodified lines | ||
| 67 | 67 | static int d3d12va_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) |
| 68 | 68 | { |
| 69 | 69 | const VC1Context *v = avctx->priv_data; |
| 70 | − D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |
| 70 | + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic_ptr->hwaccel_picture_private; | |
| 71 | 71 | |
| 72 | 72 | if (ctx_pic->slice_count >= MAX_SLICES) { |
| 73 | 73 | return AVERROR(ERANGE); |
| @@ -93,7 +93,7 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU · 19 unmodified lines | ||
| 93 | 93 | { |
| 94 | 94 | const VC1Context *v = avctx->priv_data; |
| 95 | 95 | const MpegEncContext *s = &v->s; |
| 96 | − D3D12DecodePictureContext *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 96 | + D3D12DecodePictureContext *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 97 | 97 | D3D12_VIDEO_DECODE_FRAME_ARGUMENT *args = &input_args->FrameArguments[input_args->NumFrameArguments++]; |
| 98 | 98 | |
| 99 | 99 | const unsigned mb_count = s->mb_width * (s->mb_height >> v->field_mode); |
| @@ -151,12 +151,12 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU · 51 unmodified lines | ||
| 151 | 151 | static int d3d12va_vc1_end_frame(AVCodecContext *avctx) |
| 152 | 152 | { |
| 153 | 153 | const VC1Context *v = avctx->priv_data; |
| 154 | − D3D12DecodePictureContext *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |
| 154 | + D3D12DecodePictureContext *ctx_pic = v->s.cur_pic_ptr->hwaccel_picture_private; | |
| 155 | 155 | |
| 156 | 156 | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) |
| 157 | 157 | return -1; |
| 158 | 158 | |
| 159 | − return ff_d3d12va_common_end_frame(avctx, v->s.current_picture_ptr->f, | |
| 159 | + return ff_d3d12va_common_end_frame(avctx, v->s.cur_pic_ptr->f, | |
| 160 | 160 | &ctx_pic->pp, sizeof(ctx_pic->pp), |
| 161 | 161 | NULL, 0, |
| 162 | 162 | update_input_arguments); |
| @@ -45,17 +45,17 @@ void ff_dxva2_mpeg2_fill_picture_parameters(AVCodecContext *avctx, · 44 unmodified lines | ||
| 45 | 45 | DXVA_PictureParameters *pp) |
| 46 | 46 | { |
| 47 | 47 | const struct MpegEncContext *s = avctx->priv_data; |
| 48 | − const Picture *current_picture = s->current_picture_ptr; | |
| 48 | + const Picture *current_picture = s->cur_pic_ptr; | |
| 49 | 49 | int is_field = s->picture_structure != PICT_FRAME; |
| 50 | 50 | |
| 51 | 51 | memset(pp, 0, sizeof(*pp)); |
| 52 | 52 | pp->wDeblockedPictureIndex = 0; |
| 53 | 53 | if (s->pict_type != AV_PICTURE_TYPE_I) |
| 54 | − pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f, 0); | |
| 54 | + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.f, 0); | |
| 55 | 55 | else |
| 56 | 56 | pp->wForwardRefPictureIndex = 0xffff; |
| 57 | 57 | if (s->pict_type == AV_PICTURE_TYPE_B) |
| 58 | − pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f, 0); | |
| 58 | + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.f, 0); | |
| 59 | 59 | else |
| 60 | 60 | pp->wBackwardRefPictureIndex = 0xffff; |
| 61 | 61 | pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f, 1); |
| @@ -157,7 +157,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 95 unmodified lines | ||
| 157 | 157 | const struct MpegEncContext *s = avctx->priv_data; |
| 158 | 158 | AVDXVAContext *ctx = DXVA_CONTEXT(avctx); |
| 159 | 159 | struct dxva2_picture_context *ctx_pic = |
| 160 | − s->current_picture_ptr->hwaccel_picture_private; | |
| 160 | + s->cur_pic_ptr->hwaccel_picture_private; | |
| 161 | 161 | const int is_field = s->picture_structure != PICT_FRAME; |
| 162 | 162 | const unsigned mb_count = s->mb_width * (s->mb_height >> is_field); |
| 163 | 163 | void *dxva_data_ptr; |
| @@ -260,7 +260,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, · 96 unmodified lines | ||
| 260 | 260 | const struct MpegEncContext *s = avctx->priv_data; |
| 261 | 261 | AVDXVAContext *ctx = DXVA_CONTEXT(avctx); |
| 262 | 262 | struct dxva2_picture_context *ctx_pic = |
| 263 | − s->current_picture_ptr->hwaccel_picture_private; | |
| 263 | + s->cur_pic_ptr->hwaccel_picture_private; | |
| 264 | 264 | |
| 265 | 265 | if (!DXVA_CONTEXT_VALID(avctx, ctx)) |
| 266 | 266 | return -1; |
| @@ -280,7 +280,7 @@ static int dxva2_mpeg2_decode_slice(AVCodecContext *avctx, · 13 unmodified lines | ||
| 280 | 280 | { |
| 281 | 281 | const struct MpegEncContext *s = avctx->priv_data; |
| 282 | 282 | struct dxva2_picture_context *ctx_pic = |
| 283 | − s->current_picture_ptr->hwaccel_picture_private; | |
| 283 | + s->cur_pic_ptr->hwaccel_picture_private; | |
| 284 | 284 | unsigned position; |
| 285 | 285 | |
| 286 | 286 | if (ctx_pic->slice_count >= MAX_SLICES) { |
| @@ -302,12 +302,12 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) · 15 unmodified lines | ||
| 302 | 302 | { |
| 303 | 303 | struct MpegEncContext *s = avctx->priv_data; |
| 304 | 304 | struct dxva2_picture_context *ctx_pic = |
| 305 | − s->current_picture_ptr->hwaccel_picture_private; | |
| 305 | + s->cur_pic_ptr->hwaccel_picture_private; | |
| 306 | 306 | int ret; |
| 307 | 307 | |
| 308 | 308 | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) |
| 309 | 309 | return -1; |
| 310 | − ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr->f, | |
| 310 | + ret = ff_dxva2_common_end_frame(avctx, s->cur_pic_ptr->f, | |
| 311 | 311 | &ctx_pic->pp, sizeof(ctx_pic->pp), |
| 312 | 312 | &ctx_pic->qm, sizeof(ctx_pic->qm), |
| 313 | 313 | commit_bitstream_and_slice_buffer); |
| @@ -46,7 +46,7 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, · 45 unmodified lines | ||
| 46 | 46 | { |
| 47 | 47 | const VC1Context *v = avctx->priv_data; |
| 48 | 48 | const MpegEncContext *s = &v->s; |
| 49 | − const Picture *current_picture = s->current_picture_ptr; | |
| 49 | + const Picture *current_picture = s->cur_pic_ptr; | |
| 50 | 50 | int intcomp = 0; |
| 51 | 51 | |
| 52 | 52 | // determine if intensity compensation is needed |
| @@ -59,11 +59,11 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, · 6 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | memset(pp, 0, sizeof(*pp)); |
| 61 | 61 | if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type) |
| 62 | − pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f, 0); | |
| 62 | + pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.f, 0); | |
| 63 | 63 | else |
| 64 | 64 | pp->wForwardRefPictureIndex = 0xffff; |
| 65 | 65 | if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type) |
| 66 | − pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f, 0); | |
| 66 | + pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.f, 0); | |
| 67 | 67 | else |
| 68 | 68 | pp->wBackwardRefPictureIndex = 0xffff; |
| 69 | 69 | pp->wDecodedPictureIndex = |
| @@ -191,7 +191,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 121 unmodified lines | ||
| 191 | 191 | const VC1Context *v = avctx->priv_data; |
| 192 | 192 | AVDXVAContext *ctx = DXVA_CONTEXT(avctx); |
| 193 | 193 | const MpegEncContext *s = &v->s; |
| 194 | − struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 194 | + struct dxva2_picture_context *ctx_pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 195 | 195 | |
| 196 | 196 | static const uint8_t start_code[] = { 0, 0, 1, 0x0d }; |
| 197 | 197 | const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0; |
| @@ -317,7 +317,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, · 119 unmodified lines | ||
| 317 | 317 | { |
| 318 | 318 | const VC1Context *v = avctx->priv_data; |
| 319 | 319 | AVDXVAContext *ctx = DXVA_CONTEXT(avctx); |
| 320 | − struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |
| 320 | + struct dxva2_picture_context *ctx_pic = v->s.cur_pic_ptr->hwaccel_picture_private; | |
| 321 | 321 | |
| 322 | 322 | if (!DXVA_CONTEXT_VALID(avctx, ctx)) |
| 323 | 323 | return -1; |
| @@ -336,7 +336,7 @@ static int dxva2_vc1_decode_slice(AVCodecContext *avctx, · 12 unmodified lines | ||
| 336 | 336 | uint32_t size) |
| 337 | 337 | { |
| 338 | 338 | const VC1Context *v = avctx->priv_data; |
| 339 | − const Picture *current_picture = v->s.current_picture_ptr; | |
| 339 | + const Picture *current_picture = v->s.cur_pic_ptr; | |
| 340 | 340 | struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private; |
| 341 | 341 | unsigned position; |
| 342 | 342 | |
| @@ -364,13 +364,13 @@ static int dxva2_vc1_decode_slice(AVCodecContext *avctx, · 21 unmodified lines | ||
| 364 | 364 | static int dxva2_vc1_end_frame(AVCodecContext *avctx) |
| 365 | 365 | { |
| 366 | 366 | VC1Context *v = avctx->priv_data; |
| 367 | − struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private; | |
| 367 | + struct dxva2_picture_context *ctx_pic = v->s.cur_pic_ptr->hwaccel_picture_private; | |
| 368 | 368 | int ret; |
| 369 | 369 | |
| 370 | 370 | if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) |
| 371 | 371 | return -1; |
| 372 | 372 | |
| 373 | − ret = ff_dxva2_common_end_frame(avctx, v->s.current_picture_ptr->f, | |
| 373 | + ret = ff_dxva2_common_end_frame(avctx, v->s.cur_pic_ptr->f, | |
| 374 | 374 | &ctx_pic->pp, sizeof(ctx_pic->pp), |
| 375 | 375 | NULL, 0, |
| 376 | 376 | commit_bitstream_and_slice_buffer); |
| @@ -228,17 +228,17 @@ static int h261_decode_mb_skipped(H261DecContext *h, int mba1, int mba2) · 227 unmodified lines | ||
| 228 | 228 | |
| 229 | 229 | s->mv_dir = MV_DIR_FORWARD; |
| 230 | 230 | s->mv_type = MV_TYPE_16X16; |
| 231 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 231 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 232 | 232 | s->mv[0][0][0] = 0; |
| 233 | 233 | s->mv[0][0][1] = 0; |
| 234 | 234 | s->mb_skipped = 1; |
| 235 | 235 | h->common.mtype &= ~MB_TYPE_H261_FIL; |
| 236 | 236 | |
| 237 | − if (s->current_picture.motion_val[0]) { | |
| 237 | + if (s->cur_pic.motion_val[0]) { | |
| 238 | 238 | int b_stride = 2*s->mb_width + 1; |
| 239 | 239 | int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride; |
| 240 | − s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0]; | |
| 241 | − s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1]; | |
| 240 | + s->cur_pic.motion_val[0][b_xy][0] = s->mv[0][0][0]; | |
| 241 | + s->cur_pic.motion_val[0][b_xy][1] = s->mv[0][0][1]; | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | ff_mpv_reconstruct_mb(s, s->block); |
| @@ -452,22 +452,22 @@ static int h261_decode_mb(H261DecContext *h) · 207 unmodified lines | ||
| 452 | 452 | cbp = get_vlc2(&s->gb, h261_cbp_vlc, H261_CBP_VLC_BITS, 1) + 1; |
| 453 | 453 | |
| 454 | 454 | if (s->mb_intra) { |
| 455 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 455 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 456 | 456 | goto intra; |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | //set motion vectors |
| 460 | 460 | s->mv_dir = MV_DIR_FORWARD; |
| 461 | 461 | s->mv_type = MV_TYPE_16X16; |
| 462 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 462 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 463 | 463 | s->mv[0][0][0] = h->current_mv_x * 2; // gets divided by 2 in motion compensation |
| 464 | 464 | s->mv[0][0][1] = h->current_mv_y * 2; |
| 465 | 465 | |
| 466 | − if (s->current_picture.motion_val[0]) { | |
| 466 | + if (s->cur_pic.motion_val[0]) { | |
| 467 | 467 | int b_stride = 2*s->mb_width + 1; |
| 468 | 468 | int b_xy = 2 * s->mb_x + (2 * s->mb_y) * b_stride; |
| 469 | − s->current_picture.motion_val[0][b_xy][0] = s->mv[0][0][0]; | |
| 470 | − s->current_picture.motion_val[0][b_xy][1] = s->mv[0][0][1]; | |
| 469 | + s->cur_pic.motion_val[0][b_xy][0] = s->mv[0][0][0]; | |
| 470 | + s->cur_pic.motion_val[0][b_xy][1] = s->mv[0][0][1]; | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | intra: |
| @@ -649,12 +649,12 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 175 unmodified lines | ||
| 649 | 649 | } |
| 650 | 650 | ff_mpv_frame_end(s); |
| 651 | 651 | |
| 652 | − av_assert0(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); | |
| 653 | − av_assert0(s->current_picture.f->pict_type == s->pict_type); | |
| 652 | + av_assert0(s->cur_pic.f->pict_type == s->cur_pic_ptr->f->pict_type); | |
| 653 | + av_assert0(s->cur_pic.f->pict_type == s->pict_type); | |
| 654 | 654 | |
| 655 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 655 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 656 | 656 | return ret; |
| 657 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 657 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 658 | 658 | |
| 659 | 659 | *got_frame = 1; |
| 660 | 660 | |
| @@ -73,21 +73,21 @@ void ff_h263_update_motion_val(MpegEncContext * s){ · 72 unmodified lines | ||
| 73 | 73 | s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0]; |
| 74 | 74 | s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1]; |
| 75 | 75 | } |
| 76 | − s->current_picture.ref_index[0][4*mb_xy ] = | |
| 77 | − s->current_picture.ref_index[0][4*mb_xy + 1] = s->field_select[0][0]; | |
| 78 | − s->current_picture.ref_index[0][4*mb_xy + 2] = | |
| 79 | − s->current_picture.ref_index[0][4*mb_xy + 3] = s->field_select[0][1]; | |
| 76 | + s->cur_pic.ref_index[0][4*mb_xy ] = | |
| 77 | + s->cur_pic.ref_index[0][4*mb_xy + 1] = s->field_select[0][0]; | |
| 78 | + s->cur_pic.ref_index[0][4*mb_xy + 2] = | |
| 79 | + s->cur_pic.ref_index[0][4*mb_xy + 3] = s->field_select[0][1]; | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /* no update if 8X8 because it has been done during parsing */ |
| 83 | − s->current_picture.motion_val[0][xy][0] = motion_x; | |
| 84 | − s->current_picture.motion_val[0][xy][1] = motion_y; | |
| 85 | − s->current_picture.motion_val[0][xy + 1][0] = motion_x; | |
| 86 | − s->current_picture.motion_val[0][xy + 1][1] = motion_y; | |
| 87 | − s->current_picture.motion_val[0][xy + wrap][0] = motion_x; | |
| 88 | − s->current_picture.motion_val[0][xy + wrap][1] = motion_y; | |
| 89 | − s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x; | |
| 90 | − s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y; | |
| 83 | + s->cur_pic.motion_val[0][xy][0] = motion_x; | |
| 84 | + s->cur_pic.motion_val[0][xy][1] = motion_y; | |
| 85 | + s->cur_pic.motion_val[0][xy + 1][0] = motion_x; | |
| 86 | + s->cur_pic.motion_val[0][xy + 1][1] = motion_y; | |
| 87 | + s->cur_pic.motion_val[0][xy + wrap][0] = motion_x; | |
| 88 | + s->cur_pic.motion_val[0][xy + wrap][1] = motion_y; | |
| 89 | + s->cur_pic.motion_val[0][xy + 1 + wrap][0] = motion_x; | |
| 90 | + s->cur_pic.motion_val[0][xy + 1 + wrap][1] = motion_y; | |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| @@ -104,7 +104,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 10 unmodified lines | ||
| 104 | 104 | Diag Top |
| 105 | 105 | Left Center |
| 106 | 106 | */ |
| 107 | − if (!IS_SKIP(s->current_picture.mb_type[xy])) { | |
| 107 | + if (!IS_SKIP(s->cur_pic.mb_type[xy])) { | |
| 108 | 108 | qp_c= s->qscale; |
| 109 | 109 | s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize, linesize, qp_c); |
| 110 | 110 | s->h263dsp.h263_v_loop_filter(dest_y + 8 * linesize + 8, linesize, qp_c); |
| @@ -114,10 +114,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 3 unmodified lines | ||
| 114 | 114 | if(s->mb_y){ |
| 115 | 115 | int qp_dt, qp_tt, qp_tc; |
| 116 | 116 | |
| 117 | − if (IS_SKIP(s->current_picture.mb_type[xy - s->mb_stride])) | |
| 117 | + if (IS_SKIP(s->cur_pic.mb_type[xy - s->mb_stride])) | |
| 118 | 118 | qp_tt=0; |
| 119 | 119 | else |
| 120 | − qp_tt = s->current_picture.qscale_table[xy - s->mb_stride]; | |
| 120 | + qp_tt = s->cur_pic.qscale_table[xy - s->mb_stride]; | |
| 121 | 121 | |
| 122 | 122 | if(qp_c) |
| 123 | 123 | qp_tc= qp_c; |
| @@ -137,10 +137,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 13 unmodified lines | ||
| 137 | 137 | s->h263dsp.h263_h_loop_filter(dest_y - 8 * linesize + 8, linesize, qp_tt); |
| 138 | 138 | |
| 139 | 139 | if(s->mb_x){ |
| 140 | − if (qp_tt || IS_SKIP(s->current_picture.mb_type[xy - 1 - s->mb_stride])) | |
| 140 | + if (qp_tt || IS_SKIP(s->cur_pic.mb_type[xy - 1 - s->mb_stride])) | |
| 141 | 141 | qp_dt= qp_tt; |
| 142 | 142 | else |
| 143 | − qp_dt = s->current_picture.qscale_table[xy - 1 - s->mb_stride]; | |
| 143 | + qp_dt = s->cur_pic.qscale_table[xy - 1 - s->mb_stride]; | |
| 144 | 144 | |
| 145 | 145 | if(qp_dt){ |
| 146 | 146 | const int chroma_qp= s->chroma_qscale_table[qp_dt]; |
| @@ -159,10 +159,10 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 12 unmodified lines | ||
| 159 | 159 | |
| 160 | 160 | if(s->mb_x){ |
| 161 | 161 | int qp_lc; |
| 162 | − if (qp_c || IS_SKIP(s->current_picture.mb_type[xy - 1])) | |
| 162 | + if (qp_c || IS_SKIP(s->cur_pic.mb_type[xy - 1])) | |
| 163 | 163 | qp_lc= qp_c; |
| 164 | 164 | else |
| 165 | − qp_lc = s->current_picture.qscale_table[xy - 1]; | |
| 165 | + qp_lc = s->cur_pic.qscale_table[xy - 1]; | |
| 166 | 166 | |
| 167 | 167 | if(qp_lc){ |
| 168 | 168 | s->h263dsp.h263_h_loop_filter(dest_y, linesize, qp_lc); |
| @@ -184,7 +184,7 @@ int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, · 15 unmodified lines | ||
| 184 | 184 | static const int off[4]= {2, 1, 1, -1}; |
| 185 | 185 | |
| 186 | 186 | wrap = s->b8_stride; |
| 187 | − mot_val = s->current_picture.motion_val[dir] + s->block_index[block]; | |
| 187 | + mot_val = s->cur_pic.motion_val[dir] + s->block_index[block]; | |
| 188 | 188 | |
| 189 | 189 | A = mot_val[ - 1]; |
| 190 | 190 | /* special case for first (slice) line */ |
| @@ -432,22 +432,22 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 431 unmodified lines | ||
| 432 | 432 | /* no supplementary picture */ |
| 433 | 433 | if (buf_size == 0) { |
| 434 | 434 | /* special case for last picture */ |
| 435 | − if (s->low_delay == 0 && s->next_picture_ptr) { | |
| 436 | − if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) | |
| 435 | + if (s->low_delay == 0 && s->next_pic_ptr) { | |
| 436 | + if ((ret = av_frame_ref(pict, s->next_pic_ptr->f)) < 0) | |
| 437 | 437 | return ret; |
| 438 | − s->next_picture_ptr = NULL; | |
| 438 | + s->next_pic_ptr = NULL; | |
| 439 | 439 | |
| 440 | 440 | *got_frame = 1; |
| 441 | − } else if (s->skipped_last_frame && s->current_picture_ptr) { | |
| 441 | + } else if (s->skipped_last_frame && s->cur_pic_ptr) { | |
| 442 | 442 | /* Output the last picture we decoded again if the stream ended with |
| 443 | 443 | * an NVOP */ |
| 444 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 444 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 445 | 445 | return ret; |
| 446 | 446 | /* Copy props from the last input packet. Otherwise, props from the last |
| 447 | 447 | * returned picture would be reused */ |
| 448 | 448 | if ((ret = ff_decode_frame_props(avctx, pict)) < 0) |
| 449 | 449 | return ret; |
| 450 | − s->current_picture_ptr = NULL; | |
| 450 | + s->cur_pic_ptr = NULL; | |
| 451 | 451 | |
| 452 | 452 | *got_frame = 1; |
| 453 | 453 | } |
| @@ -561,7 +561,7 @@ retry: · 107 unmodified lines | ||
| 561 | 561 | s->gob_index = H263_GOB_HEIGHT(s->height); |
| 562 | 562 | |
| 563 | 563 | /* skip B-frames if we don't have reference frames */ |
| 564 | − if (!s->last_picture_ptr && | |
| 564 | + if (!s->last_pic_ptr && | |
| 565 | 565 | (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) |
| 566 | 566 | return get_consumed_bytes(s, buf_size); |
| 567 | 567 | if ((avctx->skip_frame >= AVDISCARD_NONREF && |
| @@ -647,21 +647,21 @@ frame_end: · 79 unmodified lines | ||
| 647 | 647 | if (!s->divx_packed && avctx->hwaccel) |
| 648 | 648 | ff_thread_finish_setup(avctx); |
| 649 | 649 | |
| 650 | − av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); | |
| 651 | − av_assert1(s->current_picture.f->pict_type == s->pict_type); | |
| 650 | + av_assert1(s->cur_pic.f->pict_type == s->cur_pic_ptr->f->pict_type); | |
| 651 | + av_assert1(s->cur_pic.f->pict_type == s->pict_type); | |
| 652 | 652 | if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { |
| 653 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 653 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 654 | 654 | return ret; |
| 655 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 656 | − ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 657 | − } else if (s->last_picture_ptr) { | |
| 658 | − if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) | |
| 655 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 656 | + ff_mpv_export_qp_table(s, pict, s->cur_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 657 | + } else if (s->last_pic_ptr) { | |
| 658 | + if ((ret = av_frame_ref(pict, s->last_pic_ptr->f)) < 0) | |
| 659 | 659 | return ret; |
| 660 | − ff_print_debug_info(s, s->last_picture_ptr, pict); | |
| 661 | − ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 660 | + ff_print_debug_info(s, s->last_pic_ptr, pict); | |
| 661 | + ff_mpv_export_qp_table(s, pict, s->last_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | − if (s->last_picture_ptr || s->low_delay) { | |
| 664 | + if (s->last_pic_ptr || s->low_delay) { | |
| 665 | 665 | if ( pict->format == AV_PIX_FMT_YUV420P |
| 666 | 666 | && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) { |
| 667 | 667 | for (int p = 0; p < 3; p++) { |
| @@ -357,20 +357,20 @@ static void preview_obmc(MpegEncContext *s){ · 356 unmodified lines | ||
| 357 | 357 | do{ |
| 358 | 358 | if (get_bits1(&s->gb)) { |
| 359 | 359 | /* skip mb */ |
| 360 | − mot_val = s->current_picture.motion_val[0][s->block_index[0]]; | |
| 360 | + mot_val = s->cur_pic.motion_val[0][s->block_index[0]]; | |
| 361 | 361 | mot_val[0 ]= mot_val[2 ]= |
| 362 | 362 | mot_val[0+stride]= mot_val[2+stride]= 0; |
| 363 | 363 | mot_val[1 ]= mot_val[3 ]= |
| 364 | 364 | mot_val[1+stride]= mot_val[3+stride]= 0; |
| 365 | 365 | |
| 366 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 366 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 367 | 367 | goto end; |
| 368 | 368 | } |
| 369 | 369 | cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 2); |
| 370 | 370 | }while(cbpc == 20); |
| 371 | 371 | |
| 372 | 372 | if(cbpc & 4){ |
| 373 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 373 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 374 | 374 | }else{ |
| 375 | 375 | get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); |
| 376 | 376 | if (cbpc & 8) { |
| @@ -382,7 +382,7 @@ static void preview_obmc(MpegEncContext *s){ · 5 unmodified lines | ||
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | if ((cbpc & 16) == 0) { |
| 385 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 385 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 386 | 386 | /* 16x16 motion prediction */ |
| 387 | 387 | mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); |
| 388 | 388 | if (s->umvplus) |
| @@ -400,7 +400,7 @@ static void preview_obmc(MpegEncContext *s){ · 11 unmodified lines | ||
| 400 | 400 | mot_val[1 ]= mot_val[3 ]= |
| 401 | 401 | mot_val[1+stride]= mot_val[3+stride]= my; |
| 402 | 402 | } else { |
| 403 | − s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 403 | + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 404 | 404 | for(i=0;i<4;i++) { |
| 405 | 405 | mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| 406 | 406 | if (s->umvplus) |
| @@ -750,12 +750,12 @@ static inline void set_one_direct_mv(MpegEncContext *s, Picture *p, int i) · 343 unmodified lines | ||
| 750 | 750 | static int set_direct_mv(MpegEncContext *s) |
| 751 | 751 | { |
| 752 | 752 | const int mb_index = s->mb_x + s->mb_y * s->mb_stride; |
| 753 | − Picture *p = &s->next_picture; | |
| 753 | + Picture *p = &s->next_pic; | |
| 754 | 754 | int colocated_mb_type = p->mb_type[mb_index]; |
| 755 | 755 | int i; |
| 756 | 756 | |
| 757 | 757 | if (s->codec_tag == AV_RL32("U263") && p->f->pict_type == AV_PICTURE_TYPE_I) { |
| 758 | − p = &s->last_picture; | |
| 758 | + p = &s->last_pic; | |
| 759 | 759 | colocated_mb_type = p->mb_type[mb_index]; |
| 760 | 760 | } |
| 761 | 761 | |
| @@ -803,7 +803,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 41 unmodified lines | ||
| 803 | 803 | s->block_last_index[i] = -1; |
| 804 | 804 | s->mv_dir = MV_DIR_FORWARD; |
| 805 | 805 | s->mv_type = MV_TYPE_16X16; |
| 806 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 806 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; | |
| 807 | 807 | s->mv[0][0][0] = 0; |
| 808 | 808 | s->mv[0][0][1] = 0; |
| 809 | 809 | s->mb_skipped = !(s->obmc | s->loop_filter); |
| @@ -841,7 +841,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 31 unmodified lines | ||
| 841 | 841 | |
| 842 | 842 | s->mv_dir = MV_DIR_FORWARD; |
| 843 | 843 | if ((cbpc & 16) == 0) { |
| 844 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 844 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 845 | 845 | /* 16x16 motion prediction */ |
| 846 | 846 | s->mv_type = MV_TYPE_16X16; |
| 847 | 847 | ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); |
| @@ -866,7 +866,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 18 unmodified lines | ||
| 866 | 866 | if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) |
| 867 | 867 | skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ |
| 868 | 868 | } else { |
| 869 | − s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 869 | + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 870 | 870 | s->mv_type = MV_TYPE_8X8; |
| 871 | 871 | for(i=0;i<4;i++) { |
| 872 | 872 | mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| @@ -894,8 +894,8 @@ int ff_h263_decode_mb(MpegEncContext *s, · 21 unmodified lines | ||
| 894 | 894 | } else if(s->pict_type==AV_PICTURE_TYPE_B) { |
| 895 | 895 | int mb_type; |
| 896 | 896 | const int stride= s->b8_stride; |
| 897 | − int16_t *mot_val0 = s->current_picture.motion_val[0][2 * (s->mb_x + s->mb_y * stride)]; | |
| 898 | − int16_t *mot_val1 = s->current_picture.motion_val[1][2 * (s->mb_x + s->mb_y * stride)]; | |
| 897 | + int16_t *mot_val0 = s->cur_pic.motion_val[0][2 * (s->mb_x + s->mb_y * stride)]; | |
| 898 | + int16_t *mot_val1 = s->cur_pic.motion_val[1][2 * (s->mb_x + s->mb_y * stride)]; | |
| 899 | 899 | // const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride; |
| 900 | 900 | |
| 901 | 901 | //FIXME ugly |
| @@ -1007,7 +1007,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 105 unmodified lines | ||
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | − s->current_picture.mb_type[xy] = mb_type; | |
| 1010 | + s->cur_pic.mb_type[xy] = mb_type; | |
| 1011 | 1011 | } else { /* I-Frame */ |
| 1012 | 1012 | do{ |
| 1013 | 1013 | cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 2); |
| @@ -1022,11 +1022,11 @@ int ff_h263_decode_mb(MpegEncContext *s, · 8 unmodified lines | ||
| 1022 | 1022 | dquant = cbpc & 4; |
| 1023 | 1023 | s->mb_intra = 1; |
| 1024 | 1024 | intra: |
| 1025 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 1025 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 1026 | 1026 | if (s->h263_aic) { |
| 1027 | 1027 | s->ac_pred = get_bits1(&s->gb); |
| 1028 | 1028 | if(s->ac_pred){ |
| 1029 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; | |
| 1029 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; | |
| 1030 | 1030 | |
| 1031 | 1031 | s->h263_aic_dir = get_bits1(&s->gb); |
| 1032 | 1032 | } |
| @@ -271,7 +271,7 @@ void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line) · 270 unmodified lines | ||
| 271 | 271 | */ |
| 272 | 272 | void ff_clean_h263_qscales(MpegEncContext *s){ |
| 273 | 273 | int i; |
| 274 | − int8_t * const qscale_table = s->current_picture.qscale_table; | |
| 274 | + int8_t * const qscale_table = s->cur_pic.qscale_table; | |
| 275 | 275 | |
| 276 | 276 | ff_init_qscale_tab(s); |
| 277 | 277 | |
| @@ -565,8 +565,8 @@ void ff_h263_encode_mb(MpegEncContext * s, · 287 unmodified lines | ||
| 565 | 565 | /* motion vectors: 8x8 mode*/ |
| 566 | 566 | ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| 567 | 567 | |
| 568 | − motion_x = s->current_picture.motion_val[0][s->block_index[i]][0]; | |
| 569 | − motion_y = s->current_picture.motion_val[0][s->block_index[i]][1]; | |
| 568 | + motion_x = s->cur_pic.motion_val[0][s->block_index[i]][0]; | |
| 569 | + motion_y = s->cur_pic.motion_val[0][s->block_index[i]][1]; | |
| 570 | 570 | if (!s->umvplus) { |
| 571 | 571 | ff_h263_encode_motion_vector(s, motion_x - pred_x, |
| 572 | 572 | motion_y - pred_y, 1); |
| @@ -692,15 +692,15 @@ void ff_h263_update_mb(MpegEncContext *s) · 119 unmodified lines | ||
| 692 | 692 | { |
| 693 | 693 | const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; |
| 694 | 694 | |
| 695 | − if (s->current_picture.mbskip_table) | |
| 696 | − s->current_picture.mbskip_table[mb_xy] = s->mb_skipped; | |
| 695 | + if (s->cur_pic.mbskip_table) | |
| 696 | + s->cur_pic.mbskip_table[mb_xy] = s->mb_skipped; | |
| 697 | 697 | |
| 698 | 698 | if (s->mv_type == MV_TYPE_8X8) |
| 699 | − s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8; | |
| 699 | + s->cur_pic.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8; | |
| 700 | 700 | else if(s->mb_intra) |
| 701 | − s->current_picture.mb_type[mb_xy] = MB_TYPE_INTRA; | |
| 701 | + s->cur_pic.mb_type[mb_xy] = MB_TYPE_INTRA; | |
| 702 | 702 | else |
| 703 | − s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16; | |
| 703 | + s->cur_pic.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16; | |
| 704 | 704 | |
| 705 | 705 | ff_h263_update_motion_val(s); |
| 706 | 706 | } |
| @@ -510,16 +510,16 @@ static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4) · 509 unmodified lines | ||
| 510 | 510 | if(mv4){ |
| 511 | 511 | int mot_xy= s->block_index[0]; |
| 512 | 512 | |
| 513 | − s->current_picture.motion_val[0][mot_xy ][0] = mx; | |
| 514 | − s->current_picture.motion_val[0][mot_xy ][1] = my; | |
| 515 | − s->current_picture.motion_val[0][mot_xy + 1][0] = mx; | |
| 516 | − s->current_picture.motion_val[0][mot_xy + 1][1] = my; | |
| 513 | + s->cur_pic.motion_val[0][mot_xy ][0] = mx; | |
| 514 | + s->cur_pic.motion_val[0][mot_xy ][1] = my; | |
| 515 | + s->cur_pic.motion_val[0][mot_xy + 1][0] = mx; | |
| 516 | + s->cur_pic.motion_val[0][mot_xy + 1][1] = my; | |
| 517 | 517 | |
| 518 | 518 | mot_xy += s->b8_stride; |
| 519 | − s->current_picture.motion_val[0][mot_xy ][0] = mx; | |
| 520 | − s->current_picture.motion_val[0][mot_xy ][1] = my; | |
| 521 | − s->current_picture.motion_val[0][mot_xy + 1][0] = mx; | |
| 522 | − s->current_picture.motion_val[0][mot_xy + 1][1] = my; | |
| 519 | + s->cur_pic.motion_val[0][mot_xy ][0] = mx; | |
| 520 | + s->cur_pic.motion_val[0][mot_xy ][1] = my; | |
| 521 | + s->cur_pic.motion_val[0][mot_xy + 1][0] = mx; | |
| 522 | + s->cur_pic.motion_val[0][mot_xy + 1][1] = my; | |
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | 525 | |
| @@ -601,8 +601,8 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) · 75 unmodified lines | ||
| 601 | 601 | c->ymax = - 16*s->mb_y + s->height - 8*(block>>1); |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | − P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0]; | |
| 605 | − P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1]; | |
| 604 | + P_LEFT[0] = s->cur_pic.motion_val[0][mot_xy - 1][0]; | |
| 605 | + P_LEFT[1] = s->cur_pic.motion_val[0][mot_xy - 1][1]; | |
| 606 | 606 | |
| 607 | 607 | if (P_LEFT[0] > c->xmax * (1 << shift)) P_LEFT[0] = c->xmax * (1 << shift); |
| 608 | 608 | |
| @@ -611,10 +611,10 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) · 2 unmodified lines | ||
| 611 | 611 | c->pred_x= pred_x4= P_LEFT[0]; |
| 612 | 612 | c->pred_y= pred_y4= P_LEFT[1]; |
| 613 | 613 | } else { |
| 614 | − P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0]; | |
| 615 | − P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1]; | |
| 616 | − P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][0]; | |
| 617 | − P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][1]; | |
| 614 | + P_TOP[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][0]; | |
| 615 | + P_TOP[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][1]; | |
| 616 | + P_TOPRIGHT[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride + off[block]][0]; | |
| 617 | + P_TOPRIGHT[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride + off[block]][1]; | |
| 618 | 618 | if (P_TOP[1] > c->ymax * (1 << shift)) P_TOP[1] = c->ymax * (1 << shift); |
| 619 | 619 | if (P_TOPRIGHT[0] < c->xmin * (1 << shift)) P_TOPRIGHT[0] = c->xmin * (1 << shift); |
| 620 | 620 | if (P_TOPRIGHT[0] > c->xmax * (1 << shift)) P_TOPRIGHT[0] = c->xmax * (1 << shift); |
| @@ -675,8 +675,8 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) · 54 unmodified lines | ||
| 675 | 675 | my4_sum+= my4; |
| 676 | 676 | } |
| 677 | 677 | |
| 678 | − s->current_picture.motion_val[0][s->block_index[block]][0] = mx4; | |
| 679 | − s->current_picture.motion_val[0][s->block_index[block]][1] = my4; | |
| 678 | + s->cur_pic.motion_val[0][s->block_index[block]][0] = mx4; | |
| 679 | + s->cur_pic.motion_val[0][s->block_index[block]][1] = my4; | |
| 680 | 680 | |
| 681 | 681 | if(mx4 != mx || my4 != my) same=0; |
| 682 | 682 | } |
| @@ -686,7 +686,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) · 3 unmodified lines | ||
| 686 | 686 | |
| 687 | 687 | if (s->mecc.me_sub_cmp[0] != s->mecc.mb_cmp[0]) { |
| 688 | 688 | dmin_sum += s->mecc.mb_cmp[0](s, |
| 689 | − s->new_picture->data[0] + | |
| 689 | + s->new_pic->data[0] + | |
| 690 | 690 | s->mb_x * 16 + s->mb_y * 16 * stride, |
| 691 | 691 | c->scratchpad, stride, 16); |
| 692 | 692 | } |
| @@ -703,15 +703,15 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift) · 10 unmodified lines | ||
| 703 | 703 | offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize; |
| 704 | 704 | |
| 705 | 705 | if(s->no_rounding){ |
| 706 | − s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8); | |
| 707 | − s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8); | |
| 706 | + s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_pic.f->data[1] + offset, s->uvlinesize, 8); | |
| 707 | + s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_pic.f->data[2] + offset, s->uvlinesize, 8); | |
| 708 | 708 | }else{ |
| 709 | − s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f->data[1] + offset, s->uvlinesize, 8); | |
| 710 | − s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f->data[2] + offset, s->uvlinesize, 8); | |
| 709 | + s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_pic.f->data[1] + offset, s->uvlinesize, 8); | |
| 710 | + s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_pic.f->data[2] + offset, s->uvlinesize, 8); | |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | − dmin_sum += s->mecc.mb_cmp[1](s, s->new_picture->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); | |
| 714 | − dmin_sum += s->mecc.mb_cmp[1](s, s->new_picture->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); | |
| 713 | + dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[1] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad, s->uvlinesize, 8); | |
| 714 | + dmin_sum += s->mecc.mb_cmp[1](s, s->new_pic->data[2] + s->mb_x * 8 + s->mb_y * 8 * s->uvlinesize, c->scratchpad + 8, s->uvlinesize, 8); | |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | c->pred_x= mx; |
| @@ -899,7 +899,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, · 181 unmodified lines | ||
| 899 | 899 | const int shift= 1+s->quarter_sample; |
| 900 | 900 | int mb_type=0; |
| 901 | 901 | |
| 902 | − init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0); | |
| 902 | + init_ref(c, s->new_pic->data, s->last_pic.f->data, NULL, 16*mb_x, 16*mb_y, 0); | |
| 903 | 903 | |
| 904 | 904 | av_assert0(s->quarter_sample==0 || s->quarter_sample==1); |
| 905 | 905 | av_assert0(s->linesize == c->stride); |
| @@ -927,17 +927,17 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, · 21 unmodified lines | ||
| 927 | 927 | const int mot_stride = s->b8_stride; |
| 928 | 928 | const int mot_xy = s->block_index[0]; |
| 929 | 929 | |
| 930 | − P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0]; | |
| 931 | − P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1]; | |
| 930 | + P_LEFT[0] = s->cur_pic.motion_val[0][mot_xy - 1][0]; | |
| 931 | + P_LEFT[1] = s->cur_pic.motion_val[0][mot_xy - 1][1]; | |
| 932 | 932 | |
| 933 | 933 | if (P_LEFT[0] > (c->xmax << shift)) |
| 934 | 934 | P_LEFT[0] = c->xmax << shift; |
| 935 | 935 | |
| 936 | 936 | if (!s->first_slice_line) { |
| 937 | − P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0]; | |
| 938 | − P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1]; | |
| 939 | − P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0]; | |
| 940 | − P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1]; | |
| 937 | + P_TOP[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][0]; | |
| 938 | + P_TOP[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride ][1]; | |
| 939 | + P_TOPRIGHT[0] = s->cur_pic.motion_val[0][mot_xy - mot_stride + 2][0]; | |
| 940 | + P_TOPRIGHT[1] = s->cur_pic.motion_val[0][mot_xy - mot_stride + 2][1]; | |
| 941 | 941 | if (P_TOP[1] > (c->ymax << shift)) |
| 942 | 942 | P_TOP[1] = c->ymax << shift; |
| 943 | 943 | if (P_TOPRIGHT[0] < (c->xmin * (1 << shift))) |
| @@ -1048,9 +1048,9 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, · 104 unmodified lines | ||
| 1048 | 1048 | |
| 1049 | 1049 | if(intra_score < dmin){ |
| 1050 | 1050 | mb_type= CANDIDATE_MB_TYPE_INTRA; |
| 1051 | − s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup | |
| 1051 | + s->cur_pic.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup | |
| 1052 | 1052 | }else |
| 1053 | − s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = 0; | |
| 1053 | + s->cur_pic.mb_type[mb_y*s->mb_stride + mb_x] = 0; | |
| 1054 | 1054 | |
| 1055 | 1055 | { |
| 1056 | 1056 | int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100); |
| @@ -1070,7 +1070,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, · 13 unmodified lines | ||
| 1070 | 1070 | int P[10][2]; |
| 1071 | 1071 | const int shift= 1+s->quarter_sample; |
| 1072 | 1072 | const int xy= mb_x + mb_y*s->mb_stride; |
| 1073 | − init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0); | |
| 1073 | + init_ref(c, s->new_pic->data, s->last_pic.f->data, NULL, 16*mb_x, 16*mb_y, 0); | |
| 1074 | 1074 | |
| 1075 | 1075 | av_assert0(s->quarter_sample==0 || s->quarter_sample==1); |
| 1076 | 1076 | |
| @@ -1403,7 +1403,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) · 326 unmodified lines | ||
| 1403 | 1403 | ymin= xmin=(-32)>>shift; |
| 1404 | 1404 | ymax= xmax= 31>>shift; |
| 1405 | 1405 | |
| 1406 | − if (IS_8X8(s->next_picture.mb_type[mot_xy])) { | |
| 1406 | + if (IS_8X8(s->next_pic.mb_type[mot_xy])) { | |
| 1407 | 1407 | s->mv_type= MV_TYPE_8X8; |
| 1408 | 1408 | }else{ |
| 1409 | 1409 | s->mv_type= MV_TYPE_16X16; |
| @@ -1413,8 +1413,8 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) · 3 unmodified lines | ||
| 1413 | 1413 | int index= s->block_index[i]; |
| 1414 | 1414 | int min, max; |
| 1415 | 1415 | |
| 1416 | − c->co_located_mv[i][0] = s->next_picture.motion_val[0][index][0]; | |
| 1417 | − c->co_located_mv[i][1] = s->next_picture.motion_val[0][index][1]; | |
| 1416 | + c->co_located_mv[i][0] = s->next_pic.motion_val[0][index][0]; | |
| 1417 | + c->co_located_mv[i][1] = s->next_pic.motion_val[0][index][1]; | |
| 1418 | 1418 | c->direct_basis_mv[i][0]= c->co_located_mv[i][0]*time_pb/time_pp + ((i& 1)<<(shift+3)); |
| 1419 | 1419 | c->direct_basis_mv[i][1]= c->co_located_mv[i][1]*time_pb/time_pp + ((i>>1)<<(shift+3)); |
| 1420 | 1420 | // c->direct_basis_mv[1][i][0]= c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(shift+3); |
| @@ -1495,14 +1495,14 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, · 74 unmodified lines | ||
| 1495 | 1495 | int fmin, bmin, dmin, fbmin, bimin, fimin; |
| 1496 | 1496 | int type=0; |
| 1497 | 1497 | const int xy = mb_y*s->mb_stride + mb_x; |
| 1498 | − init_ref(c, s->new_picture->data, s->last_picture.f->data, | |
| 1499 | − s->next_picture.f->data, 16 * mb_x, 16 * mb_y, 2); | |
| 1498 | + init_ref(c, s->new_pic->data, s->last_pic.f->data, | |
| 1499 | + s->next_pic.f->data, 16 * mb_x, 16 * mb_y, 2); | |
| 1500 | 1500 | |
| 1501 | 1501 | get_limits(s, 16*mb_x, 16*mb_y); |
| 1502 | 1502 | |
| 1503 | 1503 | c->skip=0; |
| 1504 | 1504 | |
| 1505 | − if (s->codec_id == AV_CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]) { | |
| 1505 | + if (s->codec_id == AV_CODEC_ID_MPEG4 && s->next_pic.mbskip_table[xy]) { | |
| 1506 | 1506 | int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0 |
| 1507 | 1507 | |
| 1508 | 1508 | score= ((unsigned)(score*score + 128*256))>>16; |
| @@ -1681,14 +1681,14 @@ void ff_fix_long_p_mvs(MpegEncContext * s, int type) · 172 unmodified lines | ||
| 1681 | 1681 | int block; |
| 1682 | 1682 | for(block=0; block<4; block++){ |
| 1683 | 1683 | int off= (block& 1) + (block>>1)*wrap; |
| 1684 | − int mx = s->current_picture.motion_val[0][ xy + off ][0]; | |
| 1685 | − int my = s->current_picture.motion_val[0][ xy + off ][1]; | |
| 1684 | + int mx = s->cur_pic.motion_val[0][ xy + off ][0]; | |
| 1685 | + int my = s->cur_pic.motion_val[0][ xy + off ][1]; | |
| 1686 | 1686 | |
| 1687 | 1687 | if( mx >=range || mx <-range |
| 1688 | 1688 | || my >=range || my <-range){ |
| 1689 | 1689 | s->mb_type[i] &= ~CANDIDATE_MB_TYPE_INTER4V; |
| 1690 | 1690 | s->mb_type[i] |= type; |
| 1691 | − s->current_picture.mb_type[i] = type; | |
| 1691 | + s->cur_pic.mb_type[i] = type; | |
| 1692 | 1692 | } |
| 1693 | 1693 | } |
| 1694 | 1694 | } |
| @@ -437,21 +437,21 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) · 436 unmodified lines | ||
| 437 | 437 | if (s->mb_skip_run-- != 0) { |
| 438 | 438 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 439 | 439 | s->mb_skipped = 1; |
| 440 | − s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = | |
| 440 | + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = | |
| 441 | 441 | MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; |
| 442 | 442 | } else { |
| 443 | 443 | int mb_type; |
| 444 | 444 | |
| 445 | 445 | if (s->mb_x) |
| 446 | − mb_type = s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1]; | |
| 446 | + mb_type = s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride - 1]; | |
| 447 | 447 | else |
| 448 | 448 | // FIXME not sure if this is allowed in MPEG at all |
| 449 | − mb_type = s->current_picture.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1]; | |
| 449 | + mb_type = s->cur_pic.mb_type[s->mb_width + (s->mb_y - 1) * s->mb_stride - 1]; | |
| 450 | 450 | if (IS_INTRA(mb_type)) { |
| 451 | 451 | av_log(s->avctx, AV_LOG_ERROR, "skip with previntra\n"); |
| 452 | 452 | return AVERROR_INVALIDDATA; |
| 453 | 453 | } |
| 454 | − s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = | |
| 454 | + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = | |
| 455 | 455 | mb_type | MB_TYPE_SKIP; |
| 456 | 456 | |
| 457 | 457 | if ((s->mv[0][0][0] | s->mv[0][0][1] | s->mv[1][0][0] | s->mv[1][0][1]) == 0) |
| @@ -784,7 +784,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) · 326 unmodified lines | ||
| 784 | 784 | } |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | − s->current_picture.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type; | |
| 787 | + s->cur_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride] = mb_type; | |
| 788 | 788 | |
| 789 | 789 | return 0; |
| 790 | 790 | } |
| @@ -1292,36 +1292,36 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 501 unmodified lines | ||
| 1292 | 1292 | return ret; |
| 1293 | 1293 | |
| 1294 | 1294 | if (s->picture_structure != PICT_FRAME) { |
| 1295 | − s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * | |
| 1296 | − (s->picture_structure == PICT_TOP_FIELD); | |
| 1295 | + s->cur_pic_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * | |
| 1296 | + (s->picture_structure == PICT_TOP_FIELD); | |
| 1297 | 1297 | |
| 1298 | 1298 | for (int i = 0; i < 3; i++) { |
| 1299 | 1299 | if (s->picture_structure == PICT_BOTTOM_FIELD) { |
| 1300 | − s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], | |
| 1301 | − s->current_picture.f->linesize[i]); | |
| 1300 | + s->cur_pic.f->data[i] = FF_PTR_ADD(s->cur_pic.f->data[i], | |
| 1301 | + s->cur_pic.f->linesize[i]); | |
| 1302 | 1302 | } |
| 1303 | − s->current_picture.f->linesize[i] *= 2; | |
| 1304 | − s->last_picture.f->linesize[i] *= 2; | |
| 1305 | − s->next_picture.f->linesize[i] *= 2; | |
| 1303 | + s->cur_pic.f->linesize[i] *= 2; | |
| 1304 | + s->last_pic.f->linesize[i] *= 2; | |
| 1305 | + s->next_pic.f->linesize[i] *= 2; | |
| 1306 | 1306 | } |
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | ff_mpeg_er_frame_start(s); |
| 1310 | 1310 | |
| 1311 | 1311 | /* first check if we must repeat the frame */ |
| 1312 | − s->current_picture_ptr->f->repeat_pict = 0; | |
| 1312 | + s->cur_pic_ptr->f->repeat_pict = 0; | |
| 1313 | 1313 | if (s->repeat_first_field) { |
| 1314 | 1314 | if (s->progressive_sequence) { |
| 1315 | 1315 | if (s->top_field_first) |
| 1316 | − s->current_picture_ptr->f->repeat_pict = 4; | |
| 1316 | + s->cur_pic_ptr->f->repeat_pict = 4; | |
| 1317 | 1317 | else |
| 1318 | − s->current_picture_ptr->f->repeat_pict = 2; | |
| 1318 | + s->cur_pic_ptr->f->repeat_pict = 2; | |
| 1319 | 1319 | } else if (s->progressive_frame) { |
| 1320 | − s->current_picture_ptr->f->repeat_pict = 1; | |
| 1320 | + s->cur_pic_ptr->f->repeat_pict = 1; | |
| 1321 | 1321 | } |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | − ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f, | |
| 1324 | + ret = ff_frame_new_side_data(s->avctx, s->cur_pic_ptr->f, | |
| 1325 | 1325 | AV_FRAME_DATA_PANSCAN, sizeof(s1->pan_scan), |
| 1326 | 1326 | &pan_scan); |
| 1327 | 1327 | if (ret < 0) |
| @@ -1331,14 +1331,14 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 3 unmodified lines | ||
| 1331 | 1331 | |
| 1332 | 1332 | if (s1->a53_buf_ref) { |
| 1333 | 1333 | ret = ff_frame_new_side_data_from_buf( |
| 1334 | − s->avctx, s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC, | |
| 1334 | + s->avctx, s->cur_pic_ptr->f, AV_FRAME_DATA_A53_CC, | |
| 1335 | 1335 | &s1->a53_buf_ref, NULL); |
| 1336 | 1336 | if (ret < 0) |
| 1337 | 1337 | return ret; |
| 1338 | 1338 | } |
| 1339 | 1339 | |
| 1340 | 1340 | if (s1->has_stereo3d) { |
| 1341 | − AVStereo3D *stereo = av_stereo3d_create_side_data(s->current_picture_ptr->f); | |
| 1341 | + AVStereo3D *stereo = av_stereo3d_create_side_data(s->cur_pic_ptr->f); | |
| 1342 | 1342 | if (!stereo) |
| 1343 | 1343 | return AVERROR(ENOMEM); |
| 1344 | 1344 | |
| @@ -1348,7 +1348,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 3 unmodified lines | ||
| 1348 | 1348 | |
| 1349 | 1349 | if (s1->has_afd) { |
| 1350 | 1350 | AVFrameSideData *sd; |
| 1351 | − ret = ff_frame_new_side_data(s->avctx, s->current_picture_ptr->f, | |
| 1351 | + ret = ff_frame_new_side_data(s->avctx, s->cur_pic_ptr->f, | |
| 1352 | 1352 | AV_FRAME_DATA_AFD, 1, &sd); |
| 1353 | 1353 | if (ret < 0) |
| 1354 | 1354 | return ret; |
| @@ -1360,7 +1360,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 5 unmodified lines | ||
| 1360 | 1360 | if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) |
| 1361 | 1361 | ff_thread_finish_setup(avctx); |
| 1362 | 1362 | } else { // second field |
| 1363 | − if (!s->current_picture_ptr) { | |
| 1363 | + if (!s->cur_pic_ptr) { | |
| 1364 | 1364 | av_log(s->avctx, AV_LOG_ERROR, "first field missing\n"); |
| 1365 | 1365 | return AVERROR_INVALIDDATA; |
| 1366 | 1366 | } |
| @@ -1377,10 +1377,10 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 10 unmodified lines | ||
| 1377 | 1377 | return ret; |
| 1378 | 1378 | |
| 1379 | 1379 | for (int i = 0; i < 3; i++) { |
| 1380 | − s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i]; | |
| 1380 | + s->cur_pic.f->data[i] = s->cur_pic_ptr->f->data[i]; | |
| 1381 | 1381 | if (s->picture_structure == PICT_BOTTOM_FIELD) |
| 1382 | − s->current_picture.f->data[i] += | |
| 1383 | − s->current_picture_ptr->f->linesize[i]; | |
| 1382 | + s->cur_pic.f->data[i] += | |
| 1383 | + s->cur_pic_ptr->f->linesize[i]; | |
| 1384 | 1384 | } |
| 1385 | 1385 | } |
| 1386 | 1386 | |
| @@ -1507,7 +1507,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, · 120 unmodified lines | ||
| 1507 | 1507 | return ret; |
| 1508 | 1508 | |
| 1509 | 1509 | // Note motion_val is normally NULL unless we want to extract the MVs. |
| 1510 | − if (s->current_picture.motion_val[0]) { | |
| 1510 | + if (s->cur_pic.motion_val[0]) { | |
| 1511 | 1511 | const int wrap = s->b8_stride; |
| 1512 | 1512 | int xy = s->mb_x * 2 + s->mb_y * 2 * wrap; |
| 1513 | 1513 | int b8_xy = 4 * (s->mb_x + s->mb_y * s->mb_stride); |
| @@ -1527,12 +1527,12 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, · 13 unmodified lines | ||
| 1527 | 1527 | motion_y = s->mv[dir][i][1]; |
| 1528 | 1528 | } |
| 1529 | 1529 | |
| 1530 | − s->current_picture.motion_val[dir][xy][0] = motion_x; | |
| 1531 | − s->current_picture.motion_val[dir][xy][1] = motion_y; | |
| 1532 | − s->current_picture.motion_val[dir][xy + 1][0] = motion_x; | |
| 1533 | − s->current_picture.motion_val[dir][xy + 1][1] = motion_y; | |
| 1534 | − s->current_picture.ref_index [dir][b8_xy] = | |
| 1535 | − s->current_picture.ref_index [dir][b8_xy + 1] = s->field_select[dir][i]; | |
| 1530 | + s->cur_pic.motion_val[dir][xy][0] = motion_x; | |
| 1531 | + s->cur_pic.motion_val[dir][xy][1] = motion_y; | |
| 1532 | + s->cur_pic.motion_val[dir][xy + 1][0] = motion_x; | |
| 1533 | + s->cur_pic.motion_val[dir][xy + 1][1] = motion_y; | |
| 1534 | + s->cur_pic.ref_index [dir][b8_xy] = | |
| 1535 | + s->cur_pic.ref_index [dir][b8_xy + 1] = s->field_select[dir][i]; | |
| 1536 | 1536 | av_assert2(s->field_select[dir][i] == 0 || |
| 1537 | 1537 | s->field_select[dir][i] == 1); |
| 1538 | 1538 | } |
| @@ -1735,7 +1735,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output) · 196 unmodified lines | ||
| 1735 | 1735 | Mpeg1Context *s1 = avctx->priv_data; |
| 1736 | 1736 | MpegEncContext *s = &s1->mpeg_enc_ctx; |
| 1737 | 1737 | |
| 1738 | − if (!s->context_initialized || !s->current_picture_ptr) | |
| 1738 | + if (!s->context_initialized || !s->cur_pic_ptr) | |
| 1739 | 1739 | return 0; |
| 1740 | 1740 | |
| 1741 | 1741 | if (s->avctx->hwaccel) { |
| @@ -1756,20 +1756,20 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output) · 14 unmodified lines | ||
| 1756 | 1756 | ff_mpv_frame_end(s); |
| 1757 | 1757 | |
| 1758 | 1758 | if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { |
| 1759 | − int ret = av_frame_ref(pict, s->current_picture_ptr->f); | |
| 1759 | + int ret = av_frame_ref(pict, s->cur_pic_ptr->f); | |
| 1760 | 1760 | if (ret < 0) |
| 1761 | 1761 | return ret; |
| 1762 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 1763 | − ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG2); | |
| 1762 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 1763 | + ff_mpv_export_qp_table(s, pict, s->cur_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG2); | |
| 1764 | 1764 | *got_output = 1; |
| 1765 | 1765 | } else { |
| 1766 | 1766 | /* latency of 1 frame for I- and P-frames */ |
| 1767 | − if (s->last_picture_ptr && !s->last_picture_ptr->dummy) { | |
| 1768 | − int ret = av_frame_ref(pict, s->last_picture_ptr->f); | |
| 1767 | + if (s->last_pic_ptr && !s->last_pic_ptr->dummy) { | |
| 1768 | + int ret = av_frame_ref(pict, s->last_pic_ptr->f); | |
| 1769 | 1769 | if (ret < 0) |
| 1770 | 1770 | return ret; |
| 1771 | − ff_print_debug_info(s, s->last_picture_ptr, pict); | |
| 1772 | − ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG2); | |
| 1771 | + ff_print_debug_info(s, s->last_pic_ptr, pict); | |
| 1772 | + ff_mpv_export_qp_table(s, pict, s->last_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG2); | |
| 1773 | 1773 | *got_output = 1; |
| 1774 | 1774 | } |
| 1775 | 1775 | } |
| @@ -2405,7 +2405,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, · 629 unmodified lines | ||
| 2405 | 2405 | return AVERROR_INVALIDDATA; |
| 2406 | 2406 | } |
| 2407 | 2407 | |
| 2408 | − if (!s2->last_picture_ptr) { | |
| 2408 | + if (!s2->last_pic_ptr) { | |
| 2409 | 2409 | /* Skip B-frames if we do not have reference frames and |
| 2410 | 2410 | * GOP is not closed. */ |
| 2411 | 2411 | if (s2->pict_type == AV_PICTURE_TYPE_B) { |
| @@ -2419,7 +2419,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, · 7 unmodified lines | ||
| 2419 | 2419 | } |
| 2420 | 2420 | if (s2->pict_type == AV_PICTURE_TYPE_I || (s2->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL)) |
| 2421 | 2421 | s->sync = 1; |
| 2422 | − if (!s2->next_picture_ptr) { | |
| 2422 | + if (!s2->next_pic_ptr) { | |
| 2423 | 2423 | /* Skip P-frames if we do not have a reference frame or |
| 2424 | 2424 | * we have an invalid header. */ |
| 2425 | 2425 | if (s2->pict_type == AV_PICTURE_TYPE_P && !s->sync) { |
| @@ -2460,7 +2460,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, · 34 unmodified lines | ||
| 2460 | 2460 | if ((ret = mpeg_field_start(s2, buf, buf_size)) < 0) |
| 2461 | 2461 | return ret; |
| 2462 | 2462 | } |
| 2463 | − if (!s2->current_picture_ptr) { | |
| 2463 | + if (!s2->cur_pic_ptr) { | |
| 2464 | 2464 | av_log(avctx, AV_LOG_ERROR, |
| 2465 | 2465 | "current_picture not initialized\n"); |
| 2466 | 2466 | return AVERROR_INVALIDDATA; |
| @@ -2524,12 +2524,12 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, · 57 unmodified lines | ||
| 2524 | 2524 | |
| 2525 | 2525 | if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) { |
| 2526 | 2526 | /* special case for last picture */ |
| 2527 | − if (s2->low_delay == 0 && s2->next_picture_ptr) { | |
| 2528 | − int ret = av_frame_ref(picture, s2->next_picture_ptr->f); | |
| 2527 | + if (s2->low_delay == 0 && s2->next_pic_ptr) { | |
| 2528 | + int ret = av_frame_ref(picture, s2->next_pic_ptr->f); | |
| 2529 | 2529 | if (ret < 0) |
| 2530 | 2530 | return ret; |
| 2531 | 2531 | |
| 2532 | − s2->next_picture_ptr = NULL; | |
| 2532 | + s2->next_pic_ptr = NULL; | |
| 2533 | 2533 | |
| 2534 | 2534 | *got_output = 1; |
| 2535 | 2535 | } |
| @@ -2552,14 +2552,14 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, · 16 unmodified lines | ||
| 2552 | 2552 | } |
| 2553 | 2553 | s->extradata_decoded = 1; |
| 2554 | 2554 | if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) { |
| 2555 | − s2->current_picture_ptr = NULL; | |
| 2555 | + s2->cur_pic_ptr = NULL; | |
| 2556 | 2556 | return ret; |
| 2557 | 2557 | } |
| 2558 | 2558 | } |
| 2559 | 2559 | |
| 2560 | 2560 | ret = decode_chunks(avctx, picture, got_output, buf, buf_size); |
| 2561 | 2561 | if (ret<0 || *got_output) { |
| 2562 | − s2->current_picture_ptr = NULL; | |
| 2562 | + s2->cur_pic_ptr = NULL; | |
| 2563 | 2563 | |
| 2564 | 2564 | if (s->timecode_frame_start != -1 && *got_output) { |
| 2565 | 2565 | char tcbuf[AV_TIMECODE_STR_SIZE]; |
| @@ -290,7 +290,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) · 289 unmodified lines | ||
| 290 | 290 | AVRational aspect_ratio = s->avctx->sample_aspect_ratio; |
| 291 | 291 | int aspect_ratio_info; |
| 292 | 292 | |
| 293 | − if (!(s->current_picture.f->flags & AV_FRAME_FLAG_KEY)) | |
| 293 | + if (!(s->cur_pic.f->flags & AV_FRAME_FLAG_KEY)) | |
| 294 | 294 | return; |
| 295 | 295 | |
| 296 | 296 | if (aspect_ratio.num == 0 || aspect_ratio.den == 0) |
| @@ -382,7 +382,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) · 85 unmodified lines | ||
| 382 | 382 | put_bits(&s->pb, 2, mpeg12->frame_rate_ext.num-1); // frame_rate_ext_n |
| 383 | 383 | put_bits(&s->pb, 5, mpeg12->frame_rate_ext.den-1); // frame_rate_ext_d |
| 384 | 384 | |
| 385 | − side_data = av_frame_get_side_data(s->current_picture_ptr->f, AV_FRAME_DATA_PANSCAN); | |
| 385 | + side_data = av_frame_get_side_data(s->cur_pic_ptr->f, AV_FRAME_DATA_PANSCAN); | |
| 386 | 386 | if (side_data) { |
| 387 | 387 | const AVPanScan *pan_scan = (AVPanScan *)side_data->data; |
| 388 | 388 | if (pan_scan->width && pan_scan->height) { |
| @@ -419,10 +419,10 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) · 30 unmodified lines | ||
| 419 | 419 | /* time code: we must convert from the real frame rate to a |
| 420 | 420 | * fake MPEG frame rate in case of low frame rate */ |
| 421 | 421 | fps = (framerate.num + framerate.den / 2) / framerate.den; |
| 422 | − time_code = s->current_picture_ptr->coded_picture_number + | |
| 422 | + time_code = s->cur_pic_ptr->coded_picture_number + | |
| 423 | 423 | mpeg12->timecode_frame_start; |
| 424 | 424 | |
| 425 | − mpeg12->gop_picture_number = s->current_picture_ptr->coded_picture_number; | |
| 425 | + mpeg12->gop_picture_number = s->cur_pic_ptr->coded_picture_number; | |
| 426 | 426 | |
| 427 | 427 | av_assert0(mpeg12->drop_frame_timecode == !!(mpeg12->tc.flags & AV_TIMECODE_FLAG_DROPFRAME)); |
| 428 | 428 | if (mpeg12->drop_frame_timecode) |
| @@ -530,7 +530,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s) · 101 unmodified lines | ||
| 530 | 530 | if (s->progressive_sequence) |
| 531 | 531 | put_bits(&s->pb, 1, 0); /* no repeat */ |
| 532 | 532 | else |
| 533 | − put_bits(&s->pb, 1, !!(s->current_picture_ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); | |
| 533 | + put_bits(&s->pb, 1, !!(s->cur_pic_ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); | |
| 534 | 534 | /* XXX: optimize the generation of this flag with entropy measures */ |
| 535 | 535 | s->frame_pred_frame_dct = s->progressive_sequence; |
| 536 | 536 | |
| @@ -554,7 +554,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s) · 17 unmodified lines | ||
| 554 | 554 | for (i = 0; i < sizeof(svcd_scan_offset_placeholder); i++) |
| 555 | 555 | put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]); |
| 556 | 556 | } |
| 557 | − side_data = av_frame_get_side_data(s->current_picture_ptr->f, | |
| 557 | + side_data = av_frame_get_side_data(s->cur_pic_ptr->f, | |
| 558 | 558 | AV_FRAME_DATA_STEREO3D); |
| 559 | 559 | if (side_data) { |
| 560 | 560 | AVStereo3D *stereo = (AVStereo3D *)side_data->data; |
| @@ -594,7 +594,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s) · 33 unmodified lines | ||
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | if (CONFIG_MPEG2VIDEO_ENCODER && mpeg12->a53_cc) { |
| 597 | − side_data = av_frame_get_side_data(s->current_picture_ptr->f, | |
| 597 | + side_data = av_frame_get_side_data(s->cur_pic_ptr->f, | |
| 598 | 598 | AV_FRAME_DATA_A53_CC); |
| 599 | 599 | if (side_data) { |
| 600 | 600 | if (side_data->size <= A53_MAX_CC_COUNT * 3 && side_data->size % 3 == 0) { |
| @@ -98,7 +98,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, · 97 unmodified lines | ||
| 98 | 98 | uint16_t time_pb = s->pb_time; |
| 99 | 99 | int p_mx, p_my; |
| 100 | 100 | |
| 101 | − p_mx = s->next_picture.motion_val[0][xy][0]; | |
| 101 | + p_mx = s->next_pic.motion_val[0][xy][0]; | |
| 102 | 102 | if ((unsigned)(p_mx + tab_bias) < tab_size) { |
| 103 | 103 | s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias] + mx; |
| 104 | 104 | s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx |
| @@ -108,7 +108,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, · 3 unmodified lines | ||
| 108 | 108 | s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx |
| 109 | 109 | : p_mx * (time_pb - time_pp) / time_pp; |
| 110 | 110 | } |
| 111 | − p_my = s->next_picture.motion_val[0][xy][1]; | |
| 111 | + p_my = s->next_pic.motion_val[0][xy][1]; | |
| 112 | 112 | if ((unsigned)(p_my + tab_bias) < tab_size) { |
| 113 | 113 | s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias] + my; |
| 114 | 114 | s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my |
| @@ -129,7 +129,7 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, · 14 unmodified lines | ||
| 129 | 129 | int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) |
| 130 | 130 | { |
| 131 | 131 | const int mb_index = s->mb_x + s->mb_y * s->mb_stride; |
| 132 | − const int colocated_mb_type = s->next_picture.mb_type[mb_index]; | |
| 132 | + const int colocated_mb_type = s->next_pic.mb_type[mb_index]; | |
| 133 | 133 | uint16_t time_pp; |
| 134 | 134 | uint16_t time_pb; |
| 135 | 135 | int i; |
| @@ -145,7 +145,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my) · 9 unmodified lines | ||
| 145 | 145 | } else if (IS_INTERLACED(colocated_mb_type)) { |
| 146 | 146 | s->mv_type = MV_TYPE_FIELD; |
| 147 | 147 | for (i = 0; i < 2; i++) { |
| 148 | − int field_select = s->next_picture.ref_index[0][4 * mb_index + 2 * i]; | |
| 148 | + int field_select = s->next_pic.ref_index[0][4 * mb_index + 2 * i]; | |
| 149 | 149 | s->field_select[0][i] = field_select; |
| 150 | 150 | s->field_select[1][i] = i; |
| 151 | 151 | if (s->top_field_first) { |
| @@ -316,7 +316,7 @@ void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, int dir) · 315 unmodified lines | ||
| 316 | 316 | { |
| 317 | 317 | int i; |
| 318 | 318 | int16_t *ac_val, *ac_val1; |
| 319 | − int8_t *const qscale_table = s->current_picture.qscale_table; | |
| 319 | + int8_t *const qscale_table = s->cur_pic.qscale_table; | |
| 320 | 320 | |
| 321 | 321 | /* find prediction */ |
| 322 | 322 | ac_val = &s->ac_val[0][0][0] + s->block_index[n] * 16; |
| @@ -970,13 +970,13 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) · 647 unmodified lines | ||
| 970 | 970 | } while (cbpc == 8); |
| 971 | 971 | |
| 972 | 972 | s->cbp_table[xy] = cbpc & 3; |
| 973 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 973 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 974 | 974 | s->mb_intra = 1; |
| 975 | 975 | |
| 976 | 976 | if (cbpc & 4) |
| 977 | 977 | ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); |
| 978 | 978 | |
| 979 | − s->current_picture.qscale_table[xy] = s->qscale; | |
| 979 | + s->cur_pic.qscale_table[xy] = s->qscale; | |
| 980 | 980 | |
| 981 | 981 | s->mbintra_table[xy] = 1; |
| 982 | 982 | for (i = 0; i < 6; i++) { |
| @@ -994,7 +994,7 @@ static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx) · 11 unmodified lines | ||
| 994 | 994 | s->pred_dir_table[xy] = dir; |
| 995 | 995 | } else { /* P/S_TYPE */ |
| 996 | 996 | int mx, my, pred_x, pred_y, bits; |
| 997 | − int16_t *const mot_val = s->current_picture.motion_val[0][s->block_index[0]]; | |
| 997 | + int16_t *const mot_val = s->cur_pic.motion_val[0][s->block_index[0]]; | |
| 998 | 998 | const int stride = s->b8_stride * 2; |
| 999 | 999 | |
| 1000 | 1000 | try_again: |
| @@ -1007,14 +1007,14 @@ try_again: · 6 unmodified lines | ||
| 1007 | 1007 | /* skip mb */ |
| 1008 | 1008 | if (s->pict_type == AV_PICTURE_TYPE_S && |
| 1009 | 1009 | ctx->vol_sprite_usage == GMC_SPRITE) { |
| 1010 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | | |
| 1010 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | | |
| 1011 | 1011 | MB_TYPE_16x16 | |
| 1012 | 1012 | MB_TYPE_GMC | |
| 1013 | 1013 | MB_TYPE_L0; |
| 1014 | 1014 | mx = get_amv(ctx, 0); |
| 1015 | 1015 | my = get_amv(ctx, 1); |
| 1016 | 1016 | } else { |
| 1017 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | | |
| 1017 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | | |
| 1018 | 1018 | MB_TYPE_16x16 | |
| 1019 | 1019 | MB_TYPE_L0; |
| 1020 | 1020 | mx = my = 0; |
| @@ -1047,7 +1047,7 @@ try_again: · 26 unmodified lines | ||
| 1047 | 1047 | s->mb_intra = ((cbpc & 4) != 0); |
| 1048 | 1048 | |
| 1049 | 1049 | if (s->mb_intra) { |
| 1050 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 1050 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 1051 | 1051 | s->mbintra_table[xy] = 1; |
| 1052 | 1052 | mot_val[0] = |
| 1053 | 1053 | mot_val[2] = |
| @@ -1080,12 +1080,12 @@ try_again: · 26 unmodified lines | ||
| 1080 | 1080 | my = ff_h263_decode_motion(s, pred_y, s->f_code); |
| 1081 | 1081 | if (my >= 0xffff) |
| 1082 | 1082 | return AVERROR_INVALIDDATA; |
| 1083 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | | |
| 1083 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | | |
| 1084 | 1084 | MB_TYPE_L0; |
| 1085 | 1085 | } else { |
| 1086 | 1086 | mx = get_amv(ctx, 0); |
| 1087 | 1087 | my = get_amv(ctx, 1); |
| 1088 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | | |
| 1088 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | | |
| 1089 | 1089 | MB_TYPE_GMC | |
| 1090 | 1090 | MB_TYPE_L0; |
| 1091 | 1091 | } |
| @@ -1100,7 +1100,7 @@ try_again: · 8 unmodified lines | ||
| 1100 | 1100 | mot_val[3 + stride] = my; |
| 1101 | 1101 | } else { |
| 1102 | 1102 | int i; |
| 1103 | − s->current_picture.mb_type[xy] = MB_TYPE_8x8 | | |
| 1103 | + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | | |
| 1104 | 1104 | MB_TYPE_L0; |
| 1105 | 1105 | for (i = 0; i < 4; i++) { |
| 1106 | 1106 | int16_t *mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| @@ -1156,9 +1156,9 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 49 unmodified lines | ||
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | 1158 | s->cbp_table[xy] |= cbpy << 2; |
| 1159 | − s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; | |
| 1159 | + s->cur_pic.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; | |
| 1160 | 1160 | } else { /* P || S_TYPE */ |
| 1161 | − if (IS_INTRA(s->current_picture.mb_type[xy])) { | |
| 1161 | + if (IS_INTRA(s->cur_pic.mb_type[xy])) { | |
| 1162 | 1162 | int i; |
| 1163 | 1163 | int dir = 0; |
| 1164 | 1164 | int ac_pred = get_bits1(&s->gb); |
| @@ -1172,7 +1172,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 7 unmodified lines | ||
| 1172 | 1172 | |
| 1173 | 1173 | if (s->cbp_table[xy] & 8) |
| 1174 | 1174 | ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); |
| 1175 | − s->current_picture.qscale_table[xy] = s->qscale; | |
| 1175 | + s->cur_pic.qscale_table[xy] = s->qscale; | |
| 1176 | 1176 | |
| 1177 | 1177 | for (i = 0; i < 6; i++) { |
| 1178 | 1178 | int dc_pred_dir; |
| @@ -1188,10 +1188,10 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 9 unmodified lines | ||
| 1188 | 1188 | } |
| 1189 | 1189 | s->cbp_table[xy] &= 3; // remove dquant |
| 1190 | 1190 | s->cbp_table[xy] |= cbpy << 2; |
| 1191 | − s->current_picture.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; | |
| 1191 | + s->cur_pic.mb_type[xy] |= ac_pred * MB_TYPE_ACPRED; | |
| 1192 | 1192 | s->pred_dir_table[xy] = dir; |
| 1193 | − } else if (IS_SKIP(s->current_picture.mb_type[xy])) { | |
| 1194 | − s->current_picture.qscale_table[xy] = s->qscale; | |
| 1193 | + } else if (IS_SKIP(s->cur_pic.mb_type[xy])) { | |
| 1194 | + s->cur_pic.qscale_table[xy] = s->qscale; | |
| 1195 | 1195 | s->cbp_table[xy] = 0; |
| 1196 | 1196 | } else { |
| 1197 | 1197 | int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); |
| @@ -1204,7 +1204,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count) · 6 unmodified lines | ||
| 1204 | 1204 | |
| 1205 | 1205 | if (s->cbp_table[xy] & 8) |
| 1206 | 1206 | ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]); |
| 1207 | − s->current_picture.qscale_table[xy] = s->qscale; | |
| 1207 | + s->cur_pic.qscale_table[xy] = s->qscale; | |
| 1208 | 1208 | |
| 1209 | 1209 | s->cbp_table[xy] &= 3; // remove dquant |
| 1210 | 1210 | s->cbp_table[xy] |= (cbpy ^ 0xf) << 2; |
| @@ -1567,20 +1567,20 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) · 356 unmodified lines | ||
| 1567 | 1567 | |
| 1568 | 1568 | av_assert2(s == (void*)ctx); |
| 1569 | 1569 | |
| 1570 | − mb_type = s->current_picture.mb_type[xy]; | |
| 1570 | + mb_type = s->cur_pic.mb_type[xy]; | |
| 1571 | 1571 | cbp = s->cbp_table[xy]; |
| 1572 | 1572 | |
| 1573 | 1573 | use_intra_dc_vlc = s->qscale < ctx->intra_dc_threshold; |
| 1574 | 1574 | |
| 1575 | − if (s->current_picture.qscale_table[xy] != s->qscale) | |
| 1576 | − ff_set_qscale(s, s->current_picture.qscale_table[xy]); | |
| 1575 | + if (s->cur_pic.qscale_table[xy] != s->qscale) | |
| 1576 | + ff_set_qscale(s, s->cur_pic.qscale_table[xy]); | |
| 1577 | 1577 | |
| 1578 | 1578 | if (s->pict_type == AV_PICTURE_TYPE_P || |
| 1579 | 1579 | s->pict_type == AV_PICTURE_TYPE_S) { |
| 1580 | 1580 | int i; |
| 1581 | 1581 | for (i = 0; i < 4; i++) { |
| 1582 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0]; | |
| 1583 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1]; | |
| 1582 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0]; | |
| 1583 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1]; | |
| 1584 | 1584 | } |
| 1585 | 1585 | s->mb_intra = IS_INTRA(mb_type); |
| 1586 | 1586 | |
| @@ -1594,14 +1594,14 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) · 7 unmodified lines | ||
| 1594 | 1594 | && ctx->vol_sprite_usage == GMC_SPRITE) { |
| 1595 | 1595 | s->mcsel = 1; |
| 1596 | 1596 | s->mb_skipped = 0; |
| 1597 | − s->current_picture.mbskip_table[xy] = 0; | |
| 1597 | + s->cur_pic.mbskip_table[xy] = 0; | |
| 1598 | 1598 | } else { |
| 1599 | 1599 | s->mcsel = 0; |
| 1600 | 1600 | s->mb_skipped = 1; |
| 1601 | − s->current_picture.mbskip_table[xy] = 1; | |
| 1601 | + s->cur_pic.mbskip_table[xy] = 1; | |
| 1602 | 1602 | } |
| 1603 | 1603 | } else if (s->mb_intra) { |
| 1604 | − s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); | |
| 1604 | + s->ac_pred = IS_ACPRED(s->cur_pic.mb_type[xy]); | |
| 1605 | 1605 | } else if (!s->mb_intra) { |
| 1606 | 1606 | // s->mcsel = 0; // FIXME do we need to init that? |
| 1607 | 1607 | |
| @@ -1614,7 +1614,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) · 6 unmodified lines | ||
| 1614 | 1614 | } |
| 1615 | 1615 | } else { /* I-Frame */ |
| 1616 | 1616 | s->mb_intra = 1; |
| 1617 | − s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]); | |
| 1617 | + s->ac_pred = IS_ACPRED(s->cur_pic.mb_type[xy]); | |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | 1620 | if (!IS_SKIP(mb_type)) { |
| @@ -1673,23 +1673,23 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 52 unmodified lines | ||
| 1673 | 1673 | s->mv_type = MV_TYPE_16X16; |
| 1674 | 1674 | if (s->pict_type == AV_PICTURE_TYPE_S && |
| 1675 | 1675 | ctx->vol_sprite_usage == GMC_SPRITE) { |
| 1676 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | | |
| 1676 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | | |
| 1677 | 1677 | MB_TYPE_GMC | |
| 1678 | 1678 | MB_TYPE_16x16 | |
| 1679 | 1679 | MB_TYPE_L0; |
| 1680 | 1680 | s->mcsel = 1; |
| 1681 | 1681 | s->mv[0][0][0] = get_amv(ctx, 0); |
| 1682 | 1682 | s->mv[0][0][1] = get_amv(ctx, 1); |
| 1683 | − s->current_picture.mbskip_table[xy] = 0; | |
| 1683 | + s->cur_pic.mbskip_table[xy] = 0; | |
| 1684 | 1684 | s->mb_skipped = 0; |
| 1685 | 1685 | } else { |
| 1686 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | | |
| 1686 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | | |
| 1687 | 1687 | MB_TYPE_16x16 | |
| 1688 | 1688 | MB_TYPE_L0; |
| 1689 | 1689 | s->mcsel = 0; |
| 1690 | 1690 | s->mv[0][0][0] = 0; |
| 1691 | 1691 | s->mv[0][0][1] = 0; |
| 1692 | − s->current_picture.mbskip_table[xy] = 1; | |
| 1692 | + s->cur_pic.mbskip_table[xy] = 1; | |
| 1693 | 1693 | s->mb_skipped = 1; |
| 1694 | 1694 | } |
| 1695 | 1695 | goto end; |
| @@ -1730,7 +1730,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 34 unmodified lines | ||
| 1730 | 1730 | s->mv_dir = MV_DIR_FORWARD; |
| 1731 | 1731 | if ((cbpc & 16) == 0) { |
| 1732 | 1732 | if (s->mcsel) { |
| 1733 | − s->current_picture.mb_type[xy] = MB_TYPE_GMC | | |
| 1733 | + s->cur_pic.mb_type[xy] = MB_TYPE_GMC | | |
| 1734 | 1734 | MB_TYPE_16x16 | |
| 1735 | 1735 | MB_TYPE_L0; |
| 1736 | 1736 | /* 16x16 global motion prediction */ |
| @@ -1740,7 +1740,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 3 unmodified lines | ||
| 1740 | 1740 | s->mv[0][0][0] = mx; |
| 1741 | 1741 | s->mv[0][0][1] = my; |
| 1742 | 1742 | } else if ((!s->progressive_sequence) && get_bits1(&s->gb)) { |
| 1743 | − s->current_picture.mb_type[xy] = MB_TYPE_16x8 | | |
| 1743 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x8 | | |
| 1744 | 1744 | MB_TYPE_L0 | |
| 1745 | 1745 | MB_TYPE_INTERLACED; |
| 1746 | 1746 | /* 16x8 field motion prediction */ |
| @@ -1764,7 +1764,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 17 unmodified lines | ||
| 1764 | 1764 | s->mv[0][i][1] = my; |
| 1765 | 1765 | } |
| 1766 | 1766 | } else { |
| 1767 | − s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 1767 | + s->cur_pic.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; | |
| 1768 | 1768 | /* 16x16 motion prediction */ |
| 1769 | 1769 | s->mv_type = MV_TYPE_16X16; |
| 1770 | 1770 | ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); |
| @@ -1781,7 +1781,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 10 unmodified lines | ||
| 1781 | 1781 | s->mv[0][0][1] = my; |
| 1782 | 1782 | } |
| 1783 | 1783 | } else { |
| 1784 | − s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 1784 | + s->cur_pic.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; | |
| 1785 | 1785 | s->mv_type = MV_TYPE_8X8; |
| 1786 | 1786 | for (i = 0; i < 4; i++) { |
| 1787 | 1787 | mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| @@ -1814,11 +1814,11 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 26 unmodified lines | ||
| 1814 | 1814 | s->last_mv[i][1][1] = 0; |
| 1815 | 1815 | } |
| 1816 | 1816 | |
| 1817 | − ff_thread_await_progress(&s->next_picture_ptr->tf, s->mb_y, 0); | |
| 1817 | + ff_thread_await_progress(&s->next_pic_ptr->tf, s->mb_y, 0); | |
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | 1820 | /* if we skipped it in the future P-frame than skip it now too */ |
| 1821 | − s->mb_skipped = s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC | |
| 1821 | + s->mb_skipped = s->next_pic.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC | |
| 1822 | 1822 | |
| 1823 | 1823 | if (s->mb_skipped) { |
| 1824 | 1824 | /* skip mb */ |
| @@ -1831,7 +1831,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 6 unmodified lines | ||
| 1831 | 1831 | s->mv[0][0][1] = |
| 1832 | 1832 | s->mv[1][0][0] = |
| 1833 | 1833 | s->mv[1][0][1] = 0; |
| 1834 | − s->current_picture.mb_type[xy] = MB_TYPE_SKIP | | |
| 1834 | + s->cur_pic.mb_type[xy] = MB_TYPE_SKIP | | |
| 1835 | 1835 | MB_TYPE_16x16 | |
| 1836 | 1836 | MB_TYPE_L0; |
| 1837 | 1837 | goto end; |
| @@ -1951,7 +1951,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 113 unmodified lines | ||
| 1951 | 1951 | s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; |
| 1952 | 1952 | mb_type |= ff_mpeg4_set_direct_mv(s, mx, my); |
| 1953 | 1953 | } |
| 1954 | − s->current_picture.mb_type[xy] = mb_type; | |
| 1954 | + s->cur_pic.mb_type[xy] = mb_type; | |
| 1955 | 1955 | } else { /* I-Frame */ |
| 1956 | 1956 | int use_intra_dc_vlc; |
| 1957 | 1957 | |
| @@ -1970,9 +1970,9 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 12 unmodified lines | ||
| 1970 | 1970 | intra: |
| 1971 | 1971 | s->ac_pred = get_bits1(&s->gb); |
| 1972 | 1972 | if (s->ac_pred) |
| 1973 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; | |
| 1973 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; | |
| 1974 | 1974 | else |
| 1975 | − s->current_picture.mb_type[xy] = MB_TYPE_INTRA; | |
| 1975 | + s->cur_pic.mb_type[xy] = MB_TYPE_INTRA; | |
| 1976 | 1976 | |
| 1977 | 1977 | cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc, CBPY_VLC_BITS, 1); |
| 1978 | 1978 | if (cbpy < 0) { |
| @@ -2019,11 +2019,11 @@ end: · 40 unmodified lines | ||
| 2019 | 2019 | |
| 2020 | 2020 | if (s->pict_type == AV_PICTURE_TYPE_B) { |
| 2021 | 2021 | const int delta = s->mb_x + 1 == s->mb_width ? 2 : 1; |
| 2022 | − ff_thread_await_progress(&s->next_picture_ptr->tf, | |
| 2022 | + ff_thread_await_progress(&s->next_pic_ptr->tf, | |
| 2023 | 2023 | (s->mb_x + delta >= s->mb_width) |
| 2024 | 2024 | ? FFMIN(s->mb_y + 1, s->mb_height - 1) |
| 2025 | 2025 | : s->mb_y, 0); |
| 2026 | − if (s->next_picture.mbskip_table[xy + delta]) | |
| 2026 | + if (s->next_pic.mbskip_table[xy + delta]) | |
| 2027 | 2027 | return SLICE_OK; |
| 2028 | 2028 | } |
| 2029 | 2029 | |
| @@ -142,7 +142,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], · 141 unmodified lines | ||
| 142 | 142 | { |
| 143 | 143 | int score = 0; |
| 144 | 144 | int i, n; |
| 145 | − int8_t *const qscale_table = s->current_picture.qscale_table; | |
| 145 | + int8_t *const qscale_table = s->cur_pic.qscale_table; | |
| 146 | 146 | |
| 147 | 147 | memcpy(zigzag_last_index, s->block_last_index, sizeof(int) * 6); |
| 148 | 148 | |
| @@ -222,7 +222,7 @@ static inline int decide_ac_pred(MpegEncContext *s, int16_t block[6][64], · 73 unmodified lines | ||
| 222 | 222 | void ff_clean_mpeg4_qscales(MpegEncContext *s) |
| 223 | 223 | { |
| 224 | 224 | int i; |
| 225 | − int8_t *const qscale_table = s->current_picture.qscale_table; | |
| 225 | + int8_t *const qscale_table = s->cur_pic.qscale_table; | |
| 226 | 226 | |
| 227 | 227 | ff_clean_h263_qscales(s); |
| 228 | 228 | |
| @@ -511,7 +511,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], · 282 unmodified lines | ||
| 511 | 511 | av_assert2(mb_type >= 0); |
| 512 | 512 | |
| 513 | 513 | /* nothing to do if this MB was skipped in the next P-frame */ |
| 514 | − if (s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) { // FIXME avoid DCT & ... | |
| 514 | + if (s->next_pic.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) { // FIXME avoid DCT & ... | |
| 515 | 515 | s->mv[0][0][0] = |
| 516 | 516 | s->mv[0][0][1] = |
| 517 | 517 | s->mv[1][0][0] = |
| @@ -644,7 +644,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], · 126 unmodified lines | ||
| 644 | 644 | y = s->mb_y * 16; |
| 645 | 645 | |
| 646 | 646 | offset = x + y * s->linesize; |
| 647 | − p_pic = s->new_picture->data[0] + offset; | |
| 647 | + p_pic = s->new_pic->data[0] + offset; | |
| 648 | 648 | |
| 649 | 649 | s->mb_skipped = 1; |
| 650 | 650 | for (i = 0; i < s->max_b_frames; i++) { |
| @@ -777,8 +777,8 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], · 126 unmodified lines | ||
| 777 | 777 | ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); |
| 778 | 778 | |
| 779 | 779 | ff_h263_encode_motion_vector(s, |
| 780 | − s->current_picture.motion_val[0][s->block_index[i]][0] - pred_x, | |
| 781 | − s->current_picture.motion_val[0][s->block_index[i]][1] - pred_y, | |
| 780 | + s->cur_pic.motion_val[0][s->block_index[i]][0] - pred_x, | |
| 781 | + s->cur_pic.motion_val[0][s->block_index[i]][1] - pred_y, | |
| 782 | 782 | s->f_code); |
| 783 | 783 | } |
| 784 | 784 | } |
| @@ -886,7 +886,7 @@ static void mpeg4_encode_gop_header(MpegEncContext *s) · 101 unmodified lines | ||
| 886 | 886 | put_bits(&s->pb, 16, 0); |
| 887 | 887 | put_bits(&s->pb, 16, GOP_STARTCODE); |
| 888 | 888 | |
| 889 | − time = s->current_picture_ptr->f->pts; | |
| 889 | + time = s->cur_pic_ptr->f->pts; | |
| 890 | 890 | if (s->reordered_input_picture[1]) |
| 891 | 891 | time = FFMIN(time, s->reordered_input_picture[1]->f->pts); |
| 892 | 892 | time = time * s->avctx->time_base.num; |
| @@ -1098,7 +1098,7 @@ int ff_mpeg4_encode_picture_header(MpegEncContext *s) · 205 unmodified lines | ||
| 1098 | 1098 | } |
| 1099 | 1099 | put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ |
| 1100 | 1100 | if (!s->progressive_sequence) { |
| 1101 | − put_bits(&s->pb, 1, !!(s->current_picture_ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); | |
| 1101 | + put_bits(&s->pb, 1, !!(s->cur_pic_ptr->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)); | |
| 1102 | 1102 | put_bits(&s->pb, 1, s->alternate_scan); |
| 1103 | 1103 | } |
| 1104 | 1104 | // FIXME sprite stuff |
| @@ -49,9 +49,9 @@ void ff_mpeg_er_frame_start(MpegEncContext *s) · 48 unmodified lines | ||
| 49 | 49 | { |
| 50 | 50 | ERContext *er = &s->er; |
| 51 | 51 | |
| 52 | − set_erpic(&er->cur_pic, s->current_picture_ptr); | |
| 53 | − set_erpic(&er->next_pic, s->next_picture_ptr); | |
| 54 | − set_erpic(&er->last_pic, s->last_picture_ptr); | |
| 52 | + set_erpic(&er->cur_pic, s->cur_pic_ptr); | |
| 53 | + set_erpic(&er->next_pic, s->next_pic_ptr); | |
| 54 | + set_erpic(&er->last_pic, s->last_pic_ptr); | |
| 55 | 55 | |
| 56 | 56 | er->pp_time = s->pp_time; |
| 57 | 57 | er->pb_time = s->pb_time; |
| @@ -84,13 +84,13 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, · 26 unmodified lines | ||
| 84 | 84 | if (!s->chroma_y_shift) |
| 85 | 85 | s->bdsp.clear_blocks(s->block[6]); |
| 86 | 86 | |
| 87 | − s->dest[0] = s->current_picture.f->data[0] + | |
| 87 | + s->dest[0] = s->cur_pic.f->data[0] + | |
| 88 | 88 | s->mb_y * 16 * s->linesize + |
| 89 | 89 | s->mb_x * 16; |
| 90 | − s->dest[1] = s->current_picture.f->data[1] + | |
| 90 | + s->dest[1] = s->cur_pic.f->data[1] + | |
| 91 | 91 | s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize + |
| 92 | 92 | s->mb_x * (16 >> s->chroma_x_shift); |
| 93 | − s->dest[2] = s->current_picture.f->data[2] + | |
| 93 | + s->dest[2] = s->cur_pic.f->data[2] + | |
| 94 | 94 | s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize + |
| 95 | 95 | s->mb_x * (16 >> s->chroma_x_shift); |
| 96 | 96 | |
| @@ -678,9 +678,9 @@ int ff_mpv_init_context_frame(MpegEncContext *s) · 677 unmodified lines | ||
| 678 | 678 | static void clear_context(MpegEncContext *s) |
| 679 | 679 | { |
| 680 | 680 | memset(&s->buffer_pools, 0, sizeof(s->buffer_pools)); |
| 681 | − memset(&s->next_picture, 0, sizeof(s->next_picture)); | |
| 682 | − memset(&s->last_picture, 0, sizeof(s->last_picture)); | |
| 683 | − memset(&s->current_picture, 0, sizeof(s->current_picture)); | |
| 681 | + memset(&s->next_pic, 0, sizeof(s->next_pic)); | |
| 682 | + memset(&s->last_pic, 0, sizeof(s->last_pic)); | |
| 683 | + memset(&s->cur_pic, 0, sizeof(s->cur_pic)); | |
| 684 | 684 | |
| 685 | 685 | memset(s->thread_context, 0, sizeof(s->thread_context)); |
| 686 | 686 | |
| @@ -763,9 +763,9 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) · 76 unmodified lines | ||
| 763 | 763 | goto fail_nomem; |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | − if (!(s->next_picture.f = av_frame_alloc()) || | |
| 767 | − !(s->last_picture.f = av_frame_alloc()) || | |
| 768 | − !(s->current_picture.f = av_frame_alloc())) | |
| 766 | + if (!(s->next_pic.f = av_frame_alloc()) || | |
| 767 | + !(s->last_pic.f = av_frame_alloc()) || | |
| 768 | + !(s->cur_pic.f = av_frame_alloc())) | |
| 769 | 769 | goto fail_nomem; |
| 770 | 770 | |
| 771 | 771 | if ((ret = ff_mpv_init_context_frame(s))) |
| @@ -840,15 +840,15 @@ void ff_mpv_common_end(MpegEncContext *s) · 68 unmodified lines | ||
| 840 | 840 | ff_mpv_picture_free(&s->picture[i]); |
| 841 | 841 | } |
| 842 | 842 | av_freep(&s->picture); |
| 843 | − ff_mpv_picture_free(&s->last_picture); | |
| 844 | − ff_mpv_picture_free(&s->current_picture); | |
| 845 | − ff_mpv_picture_free(&s->next_picture); | |
| 843 | + ff_mpv_picture_free(&s->last_pic); | |
| 844 | + ff_mpv_picture_free(&s->cur_pic); | |
| 845 | + ff_mpv_picture_free(&s->next_pic); | |
| 846 | 846 | |
| 847 | 847 | s->context_initialized = 0; |
| 848 | 848 | s->context_reinit = 0; |
| 849 | − s->last_picture_ptr = | |
| 850 | − s->next_picture_ptr = | |
| 851 | − s->current_picture_ptr = NULL; | |
| 849 | + s->last_pic_ptr = | |
| 850 | + s->next_pic_ptr = | |
| 851 | + s->cur_pic_ptr = NULL; | |
| 852 | 852 | s->linesize = s->uvlinesize = 0; |
| 853 | 853 | } |
| 854 | 854 | |
| @@ -881,8 +881,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s) · 26 unmodified lines | ||
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename |
| 884 | − const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics | |
| 885 | − const int uvlinesize = s->current_picture.f->linesize[1]; | |
| 884 | + const int linesize = s->cur_pic.f->linesize[0]; //not s->linesize as this would be wrong for field pics | |
| 885 | + const int uvlinesize = s->cur_pic.f->linesize[1]; | |
| 886 | 886 | const int width_of_mb = (4 + (s->avctx->bits_per_raw_sample > 8)) - s->avctx->lowres; |
| 887 | 887 | const int height_of_mb = 4 - s->avctx->lowres; |
| 888 | 888 | |
| @@ -894,9 +894,9 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename · 5 unmodified lines | ||
| 894 | 894 | s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1; |
| 895 | 895 | //block_index is not used by mpeg2, so it is not affected by chroma_format |
| 896 | 896 | |
| 897 | − s->dest[0] = s->current_picture.f->data[0] + (int)((s->mb_x - 1U) << width_of_mb); | |
| 898 | − s->dest[1] = s->current_picture.f->data[1] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); | |
| 899 | − s->dest[2] = s->current_picture.f->data[2] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); | |
| 897 | + s->dest[0] = s->cur_pic.f->data[0] + (int)((s->mb_x - 1U) << width_of_mb); | |
| 898 | + s->dest[1] = s->cur_pic.f->data[1] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); | |
| 899 | + s->dest[2] = s->cur_pic.f->data[2] + (int)((s->mb_x - 1U) << (width_of_mb - s->chroma_x_shift)); | |
| 900 | 900 | |
| 901 | 901 | if (s->picture_structure == PICT_FRAME) { |
| 902 | 902 | s->dest[0] += s->mb_y * linesize << height_of_mb; |
| @@ -156,29 +156,29 @@ typedef struct MpegEncContext { · 155 unmodified lines | ||
| 156 | 156 | * copy of the previous picture structure. |
| 157 | 157 | * note, linesize & data, might not match the previous picture (for field pictures) |
| 158 | 158 | */ |
| 159 | − Picture last_picture; | |
| 159 | + Picture last_pic; | |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | 162 | * copy of the next picture structure. |
| 163 | 163 | * note, linesize & data, might not match the next picture (for field pictures) |
| 164 | 164 | */ |
| 165 | − Picture next_picture; | |
| 165 | + Picture next_pic; | |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | 168 | * Reference to the source picture for encoding. |
| 169 | 169 | * note, linesize & data, might not match the source picture (for field pictures) |
| 170 | 170 | */ |
| 171 | − AVFrame *new_picture; | |
| 171 | + AVFrame *new_pic; | |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | 174 | * copy of the current picture structure. |
| 175 | 175 | * note, linesize & data, might not match the current picture (for field pictures) |
| 176 | 176 | */ |
| 177 | − Picture current_picture; ///< buffer to store the decompressed current picture | |
| 177 | + Picture cur_pic; ///< buffer to store the decompressed current picture | |
| 178 | 178 | |
| 179 | − Picture *last_picture_ptr; ///< pointer to the previous picture. | |
| 180 | − Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred) | |
| 181 | − Picture *current_picture_ptr; ///< pointer to the current picture | |
| 179 | + Picture *last_pic_ptr; ///< pointer to the previous picture. | |
| 180 | + Picture *next_pic_ptr; ///< pointer to the next picture (for bidir pred) | |
| 181 | + Picture *cur_pic_ptr; ///< pointer to the current picture | |
| 182 | 182 | int skipped_last_frame; |
| 183 | 183 | int last_dc[3]; ///< last DC values for MPEG-1 |
| 184 | 184 | int16_t *dc_val_base; |
| @@ -122,9 +122,9 @@ do {\ · 121 unmodified lines | ||
| 122 | 122 | }\ |
| 123 | 123 | } while (0) |
| 124 | 124 | |
| 125 | − UPDATE_PICTURE(current_picture); | |
| 126 | − UPDATE_PICTURE(last_picture); | |
| 127 | − UPDATE_PICTURE(next_picture); | |
| 125 | + UPDATE_PICTURE(cur_pic); | |
| 126 | + UPDATE_PICTURE(last_pic); | |
| 127 | + UPDATE_PICTURE(next_pic); | |
| 128 | 128 | |
| 129 | 129 | s->linesize = s1->linesize; |
| 130 | 130 | s->uvlinesize = s1->uvlinesize; |
| @@ -134,9 +134,9 @@ do {\ · 3 unmodified lines | ||
| 134 | 134 | pic < old_ctx->picture + MAX_PICTURE_COUNT) ? \ |
| 135 | 135 | &new_ctx->picture[pic - old_ctx->picture] : NULL) |
| 136 | 136 | |
| 137 | − s->last_picture_ptr = REBASE_PICTURE(s1->last_picture_ptr, s, s1); | |
| 138 | − s->current_picture_ptr = REBASE_PICTURE(s1->current_picture_ptr, s, s1); | |
| 139 | − s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1); | |
| 137 | + s->last_pic_ptr = REBASE_PICTURE(s1->last_pic_ptr, s, s1); | |
| 138 | + s->cur_pic_ptr = REBASE_PICTURE(s1->cur_pic_ptr, s, s1); | |
| 139 | + s->next_pic_ptr = REBASE_PICTURE(s1->next_pic_ptr, s, s1); | |
| 140 | 140 | |
| 141 | 141 | // Error/bug resilience |
| 142 | 142 | s->workaround_bugs = s1->workaround_bugs; |
| @@ -193,9 +193,9 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s) · 50 unmodified lines | ||
| 193 | 193 | |
| 194 | 194 | ff_mpv_free_context_frame(s); |
| 195 | 195 | |
| 196 | − s->last_picture_ptr = | |
| 197 | − s->next_picture_ptr = | |
| 198 | − s->current_picture_ptr = NULL; | |
| 196 | + s->last_pic_ptr = | |
| 197 | + s->next_pic_ptr = | |
| 198 | + s->cur_pic_ptr = NULL; | |
| 199 | 199 | |
| 200 | 200 | if ((s->width || s->height) && |
| 201 | 201 | (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0) |
| @@ -326,9 +326,9 @@ int ff_mpv_alloc_dummy_frames(MpegEncContext *s) · 124 unmodified lines | ||
| 326 | 326 | AVCodecContext *avctx = s->avctx; |
| 327 | 327 | int ret; |
| 328 | 328 | |
| 329 | − if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && | |
| 329 | + if ((!s->last_pic_ptr || !s->last_pic_ptr->f->buf[0]) && | |
| 330 | 330 | (s->pict_type != AV_PICTURE_TYPE_I)) { |
| 331 | − if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0]) | |
| 331 | + if (s->pict_type == AV_PICTURE_TYPE_B && s->next_pic_ptr && s->next_pic_ptr->f->buf[0]) | |
| 332 | 332 | av_log(avctx, AV_LOG_DEBUG, |
| 333 | 333 | "allocating dummy last picture for B frame\n"); |
| 334 | 334 | else if (s->codec_id != AV_CODEC_ID_H261 /* H.261 has no keyframes */ && |
| @@ -337,25 +337,25 @@ int ff_mpv_alloc_dummy_frames(MpegEncContext *s) · 2 unmodified lines | ||
| 337 | 337 | "warning: first frame is no keyframe\n"); |
| 338 | 338 | |
| 339 | 339 | /* Allocate a dummy frame */ |
| 340 | − ret = alloc_dummy_frame(s, &s->last_picture_ptr, &s->last_picture); | |
| 340 | + ret = alloc_dummy_frame(s, &s->last_pic_ptr, &s->last_pic); | |
| 341 | 341 | if (ret < 0) |
| 342 | 342 | return ret; |
| 343 | 343 | |
| 344 | 344 | if (!avctx->hwaccel) { |
| 345 | 345 | int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; |
| 346 | − color_frame(s->last_picture_ptr->f, luma_val); | |
| 346 | + color_frame(s->last_pic_ptr->f, luma_val); | |
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | − if ((!s->next_picture_ptr || !s->next_picture_ptr->f->buf[0]) && | |
| 349 | + if ((!s->next_pic_ptr || !s->next_pic_ptr->f->buf[0]) && | |
| 350 | 350 | s->pict_type == AV_PICTURE_TYPE_B) { |
| 351 | 351 | /* Allocate a dummy frame */ |
| 352 | − ret = alloc_dummy_frame(s, &s->next_picture_ptr, &s->next_picture); | |
| 352 | + ret = alloc_dummy_frame(s, &s->next_pic_ptr, &s->next_pic); | |
| 353 | 353 | if (ret < 0) |
| 354 | 354 | return ret; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | − av_assert0(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && | |
| 358 | − s->last_picture_ptr->f->buf[0])); | |
| 357 | + av_assert0(s->pict_type == AV_PICTURE_TYPE_I || (s->last_pic_ptr && | |
| 358 | + s->last_pic_ptr->f->buf[0])); | |
| 359 | 359 | |
| 360 | 360 | return 0; |
| 361 | 361 | } |
| @@ -376,67 +376,65 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 14 unmodified lines | ||
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | /* mark & release old frames */ |
| 379 | − if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && | |
| 380 | − s->last_picture_ptr != s->next_picture_ptr && | |
| 381 | − s->last_picture_ptr->f->buf[0]) { | |
| 382 | − ff_mpeg_unref_picture(s->last_picture_ptr); | |
| 379 | + if (s->pict_type != AV_PICTURE_TYPE_B && s->last_pic_ptr && | |
| 380 | + s->last_pic_ptr != s->next_pic_ptr && | |
| 381 | + s->last_pic_ptr->f->buf[0]) { | |
| 382 | + ff_mpeg_unref_picture(s->last_pic_ptr); | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /* release non reference/forgotten frames */ |
| 386 | 386 | for (int i = 0; i < MAX_PICTURE_COUNT; i++) { |
| 387 | 387 | if (!s->picture[i].reference || |
| 388 | − (&s->picture[i] != s->last_picture_ptr && | |
| 389 | − &s->picture[i] != s->next_picture_ptr)) { | |
| 388 | + (&s->picture[i] != s->last_pic_ptr && | |
| 389 | + &s->picture[i] != s->next_pic_ptr)) { | |
| 390 | 390 | ff_mpeg_unref_picture(&s->picture[i]); |
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | − ff_mpeg_unref_picture(&s->current_picture); | |
| 395 | − ff_mpeg_unref_picture(&s->last_picture); | |
| 396 | − ff_mpeg_unref_picture(&s->next_picture); | |
| 394 | + ff_mpeg_unref_picture(&s->cur_pic); | |
| 395 | + ff_mpeg_unref_picture(&s->last_pic); | |
| 396 | + ff_mpeg_unref_picture(&s->next_pic); | |
| 397 | 397 | |
| 398 | − ret = alloc_picture(s, &s->current_picture_ptr, | |
| 398 | + ret = alloc_picture(s, &s->cur_pic_ptr, | |
| 399 | 399 | s->pict_type != AV_PICTURE_TYPE_B && !s->droppable); |
| 400 | 400 | if (ret < 0) |
| 401 | 401 | return ret; |
| 402 | 402 | |
| 403 | − s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!s->top_field_first; | |
| 404 | − s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (!s->progressive_frame && | |
| 405 | − !s->progressive_sequence); | |
| 406 | − s->current_picture_ptr->field_picture = s->picture_structure != PICT_FRAME; | |
| 403 | + s->cur_pic_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!s->top_field_first; | |
| 404 | + s->cur_pic_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * | |
| 405 | + (!s->progressive_frame && !s->progressive_sequence); | |
| 406 | + s->cur_pic_ptr->field_picture = s->picture_structure != PICT_FRAME; | |
| 407 | 407 | |
| 408 | − s->current_picture_ptr->f->pict_type = s->pict_type; | |
| 408 | + s->cur_pic_ptr->f->pict_type = s->pict_type; | |
| 409 | 409 | if (s->pict_type == AV_PICTURE_TYPE_I) |
| 410 | − s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_KEY; | |
| 410 | + s->cur_pic_ptr->f->flags |= AV_FRAME_FLAG_KEY; | |
| 411 | 411 | else |
| 412 | − s->current_picture_ptr->f->flags &= ~AV_FRAME_FLAG_KEY; | |
| 412 | + s->cur_pic_ptr->f->flags &= ~AV_FRAME_FLAG_KEY; | |
| 413 | 413 | |
| 414 | − if ((ret = ff_mpeg_ref_picture(&s->current_picture, | |
| 415 | − s->current_picture_ptr)) < 0) | |
| 414 | + if ((ret = ff_mpeg_ref_picture(&s->cur_pic, s->cur_pic_ptr)) < 0) | |
| 416 | 415 | return ret; |
| 417 | 416 | |
| 418 | 417 | if (s->pict_type != AV_PICTURE_TYPE_B) { |
| 419 | − s->last_picture_ptr = s->next_picture_ptr; | |
| 418 | + s->last_pic_ptr = s->next_pic_ptr; | |
| 420 | 419 | if (!s->droppable) |
| 421 | − s->next_picture_ptr = s->current_picture_ptr; | |
| 420 | + s->next_pic_ptr = s->cur_pic_ptr; | |
| 422 | 421 | } |
| 423 | 422 | ff_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n", |
| 424 | − s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr, | |
| 425 | − s->last_picture_ptr ? s->last_picture_ptr->f->data[0] : NULL, | |
| 426 | − s->next_picture_ptr ? s->next_picture_ptr->f->data[0] : NULL, | |
| 427 | − s->current_picture_ptr ? s->current_picture_ptr->f->data[0] : NULL, | |
| 423 | + s->last_pic_ptr, s->next_pic_ptr, s->cur_pic_ptr, | |
| 424 | + s->last_pic_ptr ? s->last_pic_ptr->f->data[0] : NULL, | |
| 425 | + s->next_pic_ptr ? s->next_pic_ptr->f->data[0] : NULL, | |
| 426 | + s->cur_pic_ptr ? s->cur_pic_ptr->f->data[0] : NULL, | |
| 428 | 427 | s->pict_type, s->droppable); |
| 429 | 428 | |
| 430 | − if (s->last_picture_ptr) { | |
| 431 | − if (s->last_picture_ptr->f->buf[0] && | |
| 432 | − (ret = ff_mpeg_ref_picture(&s->last_picture, | |
| 433 | − s->last_picture_ptr)) < 0) | |
| 429 | + if (s->last_pic_ptr) { | |
| 430 | + if (s->last_pic_ptr->f->buf[0] && | |
| 431 | + (ret = ff_mpeg_ref_picture(&s->last_pic, | |
| 432 | + s->last_pic_ptr)) < 0) | |
| 434 | 433 | return ret; |
| 435 | 434 | } |
| 436 | − if (s->next_picture_ptr) { | |
| 437 | − if (s->next_picture_ptr->f->buf[0] && | |
| 438 | − (ret = ff_mpeg_ref_picture(&s->next_picture, | |
| 439 | − s->next_picture_ptr)) < 0) | |
| 435 | + if (s->next_pic_ptr) { | |
| 436 | + if (s->next_pic_ptr->f->buf[0] && | |
| 437 | + (ret = ff_mpeg_ref_picture(&s->next_pic, s->next_pic_ptr)) < 0) | |
| 440 | 438 | return ret; |
| 441 | 439 | } |
| 442 | 440 | |
| @@ -459,7 +457,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 16 unmodified lines | ||
| 459 | 457 | } |
| 460 | 458 | |
| 461 | 459 | if (s->avctx->debug & FF_DEBUG_NOMC) |
| 462 | − color_frame(s->current_picture_ptr->f, 0x80); | |
| 460 | + color_frame(s->cur_pic_ptr->f, 0x80); | |
| 463 | 461 | |
| 464 | 462 | return 0; |
| 465 | 463 | } |
| @@ -469,8 +467,8 @@ void ff_mpv_frame_end(MpegEncContext *s) · 3 unmodified lines | ||
| 469 | 467 | { |
| 470 | 468 | emms_c(); |
| 471 | 469 | |
| 472 | − if (s->current_picture.reference) | |
| 473 | − ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); | |
| 470 | + if (s->cur_pic.reference) | |
| 471 | + ff_thread_report_progress(&s->cur_pic_ptr->tf, INT_MAX, 0); | |
| 474 | 472 | } |
| 475 | 473 | |
| 476 | 474 | void ff_print_debug_info(const MpegEncContext *s, const Picture *p, AVFrame *pict) |
| @@ -512,8 +510,8 @@ int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, const Picture *p · 35 unmodified lines | ||
| 512 | 510 | |
| 513 | 511 | void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h) |
| 514 | 512 | { |
| 515 | − ff_draw_horiz_band(s->avctx, s->current_picture_ptr->f, | |
| 516 | − s->last_picture_ptr ? s->last_picture_ptr->f : NULL, | |
| 513 | + ff_draw_horiz_band(s->avctx, s->cur_pic_ptr->f, | |
| 514 | + s->last_pic_ptr ? s->last_pic_ptr->f : NULL, | |
| 517 | 515 | y, h, s->picture_structure, |
| 518 | 516 | s->first_field, s->low_delay); |
| 519 | 517 | } |
| @@ -527,11 +525,11 @@ void ff_mpeg_flush(AVCodecContext *avctx) · 7 unmodified lines | ||
| 527 | 525 | |
| 528 | 526 | for (int i = 0; i < MAX_PICTURE_COUNT; i++) |
| 529 | 527 | ff_mpeg_unref_picture(&s->picture[i]); |
| 530 | − s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL; | |
| 528 | + s->cur_pic_ptr = s->last_pic_ptr = s->next_pic_ptr = NULL; | |
| 531 | 529 | |
| 532 | − ff_mpeg_unref_picture(&s->current_picture); | |
| 533 | − ff_mpeg_unref_picture(&s->last_picture); | |
| 534 | − ff_mpeg_unref_picture(&s->next_picture); | |
| 530 | + ff_mpeg_unref_picture(&s->cur_pic); | |
| 531 | + ff_mpeg_unref_picture(&s->last_pic); | |
| 532 | + ff_mpeg_unref_picture(&s->next_pic); | |
| 535 | 533 | |
| 536 | 534 | s->mb_x = s->mb_y = 0; |
| 537 | 535 | |
| @@ -542,7 +540,7 @@ void ff_mpeg_flush(AVCodecContext *avctx) · 4 unmodified lines | ||
| 542 | 540 | void ff_mpv_report_decode_progress(MpegEncContext *s) |
| 543 | 541 | { |
| 544 | 542 | if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred) |
| 545 | − ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0); | |
| 543 | + ff_thread_report_progress(&s->cur_pic_ptr->tf, s->mb_y, 0); | |
| 546 | 544 | } |
| 547 | 545 | |
| 548 | 546 | |
| @@ -615,8 +613,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, · 66 unmodified lines | ||
| 615 | 613 | const int h_edge_pos = s->h_edge_pos >> lowres; |
| 616 | 614 | const int v_edge_pos = s->v_edge_pos >> lowres; |
| 617 | 615 | int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; |
| 618 | − linesize = s->current_picture.f->linesize[0] << field_based; | |
| 619 | − uvlinesize = s->current_picture.f->linesize[1] << field_based; | |
| 616 | + linesize = s->cur_pic.f->linesize[0] << field_based; | |
| 617 | + uvlinesize = s->cur_pic.f->linesize[1] << field_based; | |
| 620 | 618 | |
| 621 | 619 | // FIXME obviously not perfect but qpel will not work in lowres anyway |
| 622 | 620 | if (s->quarter_sample) { |
| @@ -861,7 +859,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 238 unmodified lines | ||
| 861 | 859 | } else { |
| 862 | 860 | if (s->picture_structure != s->field_select[dir][0] + 1 && |
| 863 | 861 | s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { |
| 864 | − ref_picture = s->current_picture_ptr->f->data; | |
| 862 | + ref_picture = s->cur_pic_ptr->f->data; | |
| 865 | 863 | } |
| 866 | 864 | mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, |
| 867 | 865 | 0, 0, s->field_select[dir][0], |
| @@ -878,7 +876,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 10 unmodified lines | ||
| 878 | 876 | s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { |
| 879 | 877 | ref2picture = ref_picture; |
| 880 | 878 | } else { |
| 881 | − ref2picture = s->current_picture_ptr->f->data; | |
| 879 | + ref2picture = s->cur_pic_ptr->f->data; | |
| 882 | 880 | } |
| 883 | 881 | |
| 884 | 882 | mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, |
| @@ -919,7 +917,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 34 unmodified lines | ||
| 919 | 917 | // opposite parity is always in the same |
| 920 | 918 | // frame if this is second field |
| 921 | 919 | if (!s->first_field) { |
| 922 | − ref_picture = s->current_picture_ptr->f->data; | |
| 920 | + ref_picture = s->cur_pic_ptr->f->data; | |
| 923 | 921 | } |
| 924 | 922 | } |
| 925 | 923 | } |
| @@ -231,11 +231,11 @@ void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix) · 230 unmodified lines | ||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | − * init s->current_picture.qscale_table from s->lambda_table | |
| 234 | + * init s->cur_pic.qscale_table from s->lambda_table | |
| 235 | 235 | */ |
| 236 | 236 | void ff_init_qscale_tab(MpegEncContext *s) |
| 237 | 237 | { |
| 238 | − int8_t * const qscale_table = s->current_picture.qscale_table; | |
| 238 | + int8_t * const qscale_table = s->cur_pic.qscale_table; | |
| 239 | 239 | int i; |
| 240 | 240 | |
| 241 | 241 | for (i = 0; i < s->mb_num; i++) { |
| @@ -821,7 +821,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 579 unmodified lines | ||
| 821 | 821 | !FF_ALLOCZ_TYPED_ARRAY(s->q_inter_matrix16, 32) || |
| 822 | 822 | !FF_ALLOCZ_TYPED_ARRAY(s->input_picture, MAX_B_FRAMES + 1) || |
| 823 | 823 | !FF_ALLOCZ_TYPED_ARRAY(s->reordered_input_picture, MAX_B_FRAMES + 1) || |
| 824 | − !(s->new_picture = av_frame_alloc())) | |
| 824 | + !(s->new_pic = av_frame_alloc())) | |
| 825 | 825 | return AVERROR(ENOMEM); |
| 826 | 826 | |
| 827 | 827 | /* Allocate MV tables; the MV and MB tables will be copied |
| @@ -996,7 +996,7 @@ av_cold int ff_mpv_encode_end(AVCodecContext *avctx) · 168 unmodified lines | ||
| 996 | 996 | for (i = 0; i < FF_ARRAY_ELEMS(s->tmp_frames); i++) |
| 997 | 997 | av_frame_free(&s->tmp_frames[i]); |
| 998 | 998 | |
| 999 | − av_frame_free(&s->new_picture); | |
| 999 | + av_frame_free(&s->new_pic); | |
| 1000 | 1000 | |
| 1001 | 1001 | av_freep(&avctx->stats_out); |
| 1002 | 1002 | |
| @@ -1340,7 +1340,6 @@ static int estimate_best_b_count(MpegEncContext *s) · 337 unmodified lines | ||
| 1340 | 1340 | return AVERROR(ENOMEM); |
| 1341 | 1341 | |
| 1342 | 1342 | //emms_c(); |
| 1343 | − //s->next_picture_ptr->quality; | |
| 1344 | 1343 | p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P]; |
| 1345 | 1344 | //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset; |
| 1346 | 1345 | b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; |
| @@ -1351,7 +1350,7 @@ static int estimate_best_b_count(MpegEncContext *s) · 4 unmodified lines | ||
| 1351 | 1350 | |
| 1352 | 1351 | for (i = 0; i < s->max_b_frames + 2; i++) { |
| 1353 | 1352 | const Picture *pre_input_ptr = i ? s->input_picture[i - 1] : |
| 1354 | − s->next_picture_ptr; | |
| 1353 | + s->next_pic_ptr; | |
| 1355 | 1354 | |
| 1356 | 1355 | if (pre_input_ptr) { |
| 1357 | 1356 | const uint8_t *data[4]; |
| @@ -1479,8 +1478,8 @@ static int select_input_picture(MpegEncContext *s) · 121 unmodified lines | ||
| 1479 | 1478 | if (!s->reordered_input_picture[0] && s->input_picture[0]) { |
| 1480 | 1479 | if (s->frame_skip_threshold || s->frame_skip_factor) { |
| 1481 | 1480 | if (s->picture_in_gop_number < s->gop_size && |
| 1482 | − s->next_picture_ptr && | |
| 1483 | − skip_check(s, s->input_picture[0], s->next_picture_ptr)) { | |
| 1481 | + s->next_pic_ptr && | |
| 1482 | + skip_check(s, s->input_picture[0], s->next_pic_ptr)) { | |
| 1484 | 1483 | // FIXME check that the gop check above is +-1 correct |
| 1485 | 1484 | ff_mpeg_unref_picture(s->input_picture[0]); |
| 1486 | 1485 | |
| @@ -1491,7 +1490,7 @@ static int select_input_picture(MpegEncContext *s) · 4 unmodified lines | ||
| 1491 | 1490 | } |
| 1492 | 1491 | |
| 1493 | 1492 | if (/*s->picture_in_gop_number >= s->gop_size ||*/ |
| 1494 | − !s->next_picture_ptr || s->intra_only) { | |
| 1493 | + !s->next_pic_ptr || s->intra_only) { | |
| 1495 | 1494 | s->reordered_input_picture[0] = s->input_picture[0]; |
| 1496 | 1495 | s->reordered_input_picture[0]->f->pict_type = AV_PICTURE_TYPE_I; |
| 1497 | 1496 | s->reordered_input_picture[0]->coded_picture_number = |
| @@ -1594,14 +1593,14 @@ static int select_input_picture(MpegEncContext *s) · 96 unmodified lines | ||
| 1594 | 1593 | } |
| 1595 | 1594 | } |
| 1596 | 1595 | no_output_pic: |
| 1597 | − av_frame_unref(s->new_picture); | |
| 1596 | + av_frame_unref(s->new_pic); | |
| 1598 | 1597 | |
| 1599 | 1598 | if (s->reordered_input_picture[0]) { |
| 1600 | 1599 | s->reordered_input_picture[0]->reference = |
| 1601 | 1600 | s->reordered_input_picture[0]->f->pict_type != |
| 1602 | 1601 | AV_PICTURE_TYPE_B ? 3 : 0; |
| 1603 | 1602 | |
| 1604 | − if ((ret = av_frame_ref(s->new_picture, | |
| 1603 | + if ((ret = av_frame_ref(s->new_pic, | |
| 1605 | 1604 | s->reordered_input_picture[0]->f))) |
| 1606 | 1605 | goto fail; |
| 1607 | 1606 | |
| @@ -1631,16 +1630,16 @@ no_output_pic: · 23 unmodified lines | ||
| 1631 | 1630 | /* mark us unused / free shared pic */ |
| 1632 | 1631 | ff_mpeg_unref_picture(s->reordered_input_picture[0]); |
| 1633 | 1632 | |
| 1634 | − s->current_picture_ptr = pic; | |
| 1633 | + s->cur_pic_ptr = pic; | |
| 1635 | 1634 | } else { |
| 1636 | 1635 | // input is not a shared pix -> reuse buffer for current_pix |
| 1637 | − s->current_picture_ptr = s->reordered_input_picture[0]; | |
| 1636 | + s->cur_pic_ptr = s->reordered_input_picture[0]; | |
| 1638 | 1637 | for (i = 0; i < 4; i++) { |
| 1639 | − if (s->new_picture->data[i]) | |
| 1640 | − s->new_picture->data[i] += INPLACE_OFFSET; | |
| 1638 | + if (s->new_pic->data[i]) | |
| 1639 | + s->new_pic->data[i] += INPLACE_OFFSET; | |
| 1641 | 1640 | } |
| 1642 | 1641 | } |
| 1643 | − s->picture_number = s->current_picture_ptr->display_picture_number; | |
| 1642 | + s->picture_number = s->cur_pic_ptr->display_picture_number; | |
| 1644 | 1643 | |
| 1645 | 1644 | } |
| 1646 | 1645 | return 0; |
| @@ -1652,24 +1651,24 @@ fail: · 5 unmodified lines | ||
| 1652 | 1651 | static void frame_end(MpegEncContext *s) |
| 1653 | 1652 | { |
| 1654 | 1653 | if (s->unrestricted_mv && |
| 1655 | − s->current_picture.reference && | |
| 1654 | + s->cur_pic.reference && | |
| 1656 | 1655 | !s->intra_only) { |
| 1657 | 1656 | int hshift = s->chroma_x_shift; |
| 1658 | 1657 | int vshift = s->chroma_y_shift; |
| 1659 | − s->mpvencdsp.draw_edges(s->current_picture.f->data[0], | |
| 1660 | − s->current_picture.f->linesize[0], | |
| 1658 | + s->mpvencdsp.draw_edges(s->cur_pic.f->data[0], | |
| 1659 | + s->cur_pic.f->linesize[0], | |
| 1661 | 1660 | s->h_edge_pos, s->v_edge_pos, |
| 1662 | 1661 | EDGE_WIDTH, EDGE_WIDTH, |
| 1663 | 1662 | EDGE_TOP | EDGE_BOTTOM); |
| 1664 | − s->mpvencdsp.draw_edges(s->current_picture.f->data[1], | |
| 1665 | − s->current_picture.f->linesize[1], | |
| 1663 | + s->mpvencdsp.draw_edges(s->cur_pic.f->data[1], | |
| 1664 | + s->cur_pic.f->linesize[1], | |
| 1666 | 1665 | s->h_edge_pos >> hshift, |
| 1667 | 1666 | s->v_edge_pos >> vshift, |
| 1668 | 1667 | EDGE_WIDTH >> hshift, |
| 1669 | 1668 | EDGE_WIDTH >> vshift, |
| 1670 | 1669 | EDGE_TOP | EDGE_BOTTOM); |
| 1671 | − s->mpvencdsp.draw_edges(s->current_picture.f->data[2], | |
| 1672 | − s->current_picture.f->linesize[2], | |
| 1670 | + s->mpvencdsp.draw_edges(s->cur_pic.f->data[2], | |
| 1671 | + s->cur_pic.f->linesize[2], | |
| 1673 | 1672 | s->h_edge_pos >> hshift, |
| 1674 | 1673 | s->v_edge_pos >> vshift, |
| 1675 | 1674 | EDGE_WIDTH >> hshift, |
| @@ -1680,7 +1679,7 @@ static void frame_end(MpegEncContext *s) · 4 unmodified lines | ||
| 1680 | 1679 | emms_c(); |
| 1681 | 1680 | |
| 1682 | 1681 | s->last_pict_type = s->pict_type; |
| 1683 | − s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality; | |
| 1682 | + s->last_lambda_for [s->pict_type] = s->cur_pic_ptr->f->quality; | |
| 1684 | 1683 | if (s->pict_type!= AV_PICTURE_TYPE_B) |
| 1685 | 1684 | s->last_non_b_pict_type = s->pict_type; |
| 1686 | 1685 | } |
| @@ -1711,36 +1710,33 @@ static int frame_start(MpegEncContext *s) · 24 unmodified lines | ||
| 1711 | 1710 | int ret; |
| 1712 | 1711 | |
| 1713 | 1712 | /* mark & release old frames */ |
| 1714 | − if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && | |
| 1715 | − s->last_picture_ptr != s->next_picture_ptr && | |
| 1716 | − s->last_picture_ptr->f->buf[0]) { | |
| 1717 | − ff_mpeg_unref_picture(s->last_picture_ptr); | |
| 1713 | + if (s->pict_type != AV_PICTURE_TYPE_B && s->last_pic_ptr && | |
| 1714 | + s->last_pic_ptr != s->next_pic_ptr && | |
| 1715 | + s->last_pic_ptr->f->buf[0]) { | |
| 1716 | + ff_mpeg_unref_picture(s->last_pic_ptr); | |
| 1718 | 1717 | } |
| 1719 | 1718 | |
| 1720 | − s->current_picture_ptr->f->pict_type = s->pict_type; | |
| 1719 | + s->cur_pic_ptr->f->pict_type = s->pict_type; | |
| 1721 | 1720 | |
| 1722 | − ff_mpeg_unref_picture(&s->current_picture); | |
| 1723 | − if ((ret = ff_mpeg_ref_picture(&s->current_picture, | |
| 1724 | − s->current_picture_ptr)) < 0) | |
| 1721 | + ff_mpeg_unref_picture(&s->cur_pic); | |
| 1722 | + if ((ret = ff_mpeg_ref_picture(&s->cur_pic, s->cur_pic_ptr)) < 0) | |
| 1725 | 1723 | return ret; |
| 1726 | 1724 | |
| 1727 | 1725 | if (s->pict_type != AV_PICTURE_TYPE_B) { |
| 1728 | − s->last_picture_ptr = s->next_picture_ptr; | |
| 1729 | − s->next_picture_ptr = s->current_picture_ptr; | |
| 1726 | + s->last_pic_ptr = s->next_pic_ptr; | |
| 1727 | + s->next_pic_ptr = s->cur_pic_ptr; | |
| 1730 | 1728 | } |
| 1731 | 1729 | |
| 1732 | − if (s->last_picture_ptr) { | |
| 1733 | − ff_mpeg_unref_picture(&s->last_picture); | |
| 1734 | − if (s->last_picture_ptr->f->buf[0] && | |
| 1735 | − (ret = ff_mpeg_ref_picture(&s->last_picture, | |
| 1736 | − s->last_picture_ptr)) < 0) | |
| 1730 | + if (s->last_pic_ptr) { | |
| 1731 | + ff_mpeg_unref_picture(&s->last_pic); | |
| 1732 | + if (s->last_pic_ptr->f->buf[0] && | |
| 1733 | + (ret = ff_mpeg_ref_picture(&s->last_pic, s->last_pic_ptr)) < 0) | |
| 1737 | 1734 | return ret; |
| 1738 | 1735 | } |
| 1739 | − if (s->next_picture_ptr) { | |
| 1740 | − ff_mpeg_unref_picture(&s->next_picture); | |
| 1741 | − if (s->next_picture_ptr->f->buf[0] && | |
| 1742 | − (ret = ff_mpeg_ref_picture(&s->next_picture, | |
| 1743 | − s->next_picture_ptr)) < 0) | |
| 1736 | + if (s->next_pic_ptr) { | |
| 1737 | + ff_mpeg_unref_picture(&s->next_pic); | |
| 1738 | + if (s->next_pic_ptr->f->buf[0] && | |
| 1739 | + (ret = ff_mpeg_ref_picture(&s->next_pic, s->next_pic_ptr)) < 0) | |
| 1744 | 1740 | return ret; |
| 1745 | 1741 | } |
| 1746 | 1742 | |
| @@ -1771,12 +1767,12 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, · 24 unmodified lines | ||
| 1771 | 1767 | } |
| 1772 | 1768 | |
| 1773 | 1769 | /* output? */ |
| 1774 | − if (s->new_picture->data[0]) { | |
| 1770 | + if (s->new_pic->data[0]) { | |
| 1775 | 1771 | int growing_buffer = context_count == 1 && !s->data_partitioning; |
| 1776 | 1772 | size_t pkt_size = 10000 + s->mb_width * s->mb_height * |
| 1777 | 1773 | (growing_buffer ? 64 : (MAX_MB_BYTES + 100)); |
| 1778 | 1774 | if (CONFIG_MJPEG_ENCODER && avctx->codec_id == AV_CODEC_ID_MJPEG) { |
| 1779 | − ret = ff_mjpeg_add_icc_profile_size(avctx, s->new_picture, &pkt_size); | |
| 1775 | + ret = ff_mjpeg_add_icc_profile_size(avctx, s->new_pic, &pkt_size); | |
| 1780 | 1776 | if (ret < 0) |
| 1781 | 1777 | return ret; |
| 1782 | 1778 | } |
| @@ -1800,7 +1796,7 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, · 17 unmodified lines | ||
| 1800 | 1796 | init_put_bits(&s->thread_context[i]->pb, start, end - start); |
| 1801 | 1797 | } |
| 1802 | 1798 | |
| 1803 | − s->pict_type = s->new_picture->pict_type; | |
| 1799 | + s->pict_type = s->new_pic->pict_type; | |
| 1804 | 1800 | //emms_c(); |
| 1805 | 1801 | ret = frame_start(s); |
| 1806 | 1802 | if (ret < 0) |
| @@ -1868,7 +1864,7 @@ vbv_retry: · 61 unmodified lines | ||
| 1868 | 1864 | for (i = 0; i < 4; i++) { |
| 1869 | 1865 | avctx->error[i] += s->encoding_error[i]; |
| 1870 | 1866 | } |
| 1871 | − ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, | |
| 1867 | + ff_side_data_set_encoder_stats(pkt, s->cur_pic.f->quality, | |
| 1872 | 1868 | s->encoding_error, |
| 1873 | 1869 | (avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0, |
| 1874 | 1870 | s->pict_type); |
| @@ -1962,10 +1958,10 @@ vbv_retry: · 87 unmodified lines | ||
| 1962 | 1958 | } |
| 1963 | 1959 | s->total_bits += s->frame_bits; |
| 1964 | 1960 | |
| 1965 | − pkt->pts = s->current_picture.f->pts; | |
| 1966 | − pkt->duration = s->current_picture.f->duration; | |
| 1961 | + pkt->pts = s->cur_pic.f->pts; | |
| 1962 | + pkt->duration = s->cur_pic.f->duration; | |
| 1967 | 1963 | if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) { |
| 1968 | − if (!s->current_picture.coded_picture_number) | |
| 1964 | + if (!s->cur_pic.coded_picture_number) | |
| 1969 | 1965 | pkt->dts = pkt->pts - s->dts_delta; |
| 1970 | 1966 | else |
| 1971 | 1967 | pkt->dts = s->reordered_pts; |
| @@ -1975,12 +1971,12 @@ vbv_retry: · 3 unmodified lines | ||
| 1975 | 1971 | |
| 1976 | 1972 | // the no-delay case is handled in generic code |
| 1977 | 1973 | if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY) { |
| 1978 | − ret = ff_encode_reordered_opaque(avctx, pkt, s->current_picture.f); | |
| 1974 | + ret = ff_encode_reordered_opaque(avctx, pkt, s->cur_pic.f); | |
| 1979 | 1975 | if (ret < 0) |
| 1980 | 1976 | return ret; |
| 1981 | 1977 | } |
| 1982 | 1978 | |
| 1983 | − if (s->current_picture.f->flags & AV_FRAME_FLAG_KEY) | |
| 1979 | + if (s->cur_pic.f->flags & AV_FRAME_FLAG_KEY) | |
| 1984 | 1980 | pkt->flags |= AV_PKT_FLAG_KEY; |
| 1985 | 1981 | if (s->mb_info) |
| 1986 | 1982 | av_packet_shrink_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, s->mb_info_size); |
| @@ -2150,7 +2146,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 163 unmodified lines | ||
| 2150 | 2146 | update_qscale(s); |
| 2151 | 2147 | |
| 2152 | 2148 | if (!(s->mpv_flags & FF_MPV_FLAG_QP_RD)) { |
| 2153 | − s->qscale = s->current_picture_ptr->qscale_table[mb_xy]; | |
| 2149 | + s->qscale = s->cur_pic_ptr->qscale_table[mb_xy]; | |
| 2154 | 2150 | s->dquant = s->qscale - last_qp; |
| 2155 | 2151 | |
| 2156 | 2152 | if (s->out_format == FMT_H263) { |
| @@ -2174,11 +2170,11 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 17 unmodified lines | ||
| 2174 | 2170 | |
| 2175 | 2171 | wrap_y = s->linesize; |
| 2176 | 2172 | wrap_c = s->uvlinesize; |
| 2177 | − ptr_y = s->new_picture->data[0] + | |
| 2173 | + ptr_y = s->new_pic->data[0] + | |
| 2178 | 2174 | (mb_y * 16 * wrap_y) + mb_x * 16; |
| 2179 | − ptr_cb = s->new_picture->data[1] + | |
| 2175 | + ptr_cb = s->new_pic->data[1] + | |
| 2180 | 2176 | (mb_y * mb_block_height * wrap_c) + mb_x * mb_block_width; |
| 2181 | − ptr_cr = s->new_picture->data[2] + | |
| 2177 | + ptr_cr = s->new_pic->data[2] + | |
| 2182 | 2178 | (mb_y * mb_block_height * wrap_c) + mb_x * mb_block_width; |
| 2183 | 2179 | |
| 2184 | 2180 | if((mb_x * 16 + 16 > s->width || mb_y * 16 + 16 > s->height) && s->codec_id != AV_CODEC_ID_AMV){ |
| @@ -2273,14 +2269,14 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 88 unmodified lines | ||
| 2273 | 2269 | |
| 2274 | 2270 | if (s->mv_dir & MV_DIR_FORWARD) { |
| 2275 | 2271 | ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, |
| 2276 | − s->last_picture.f->data, | |
| 2272 | + s->last_pic.f->data, | |
| 2277 | 2273 | op_pix, op_qpix); |
| 2278 | 2274 | op_pix = s->hdsp.avg_pixels_tab; |
| 2279 | 2275 | op_qpix = s->qdsp.avg_qpel_pixels_tab; |
| 2280 | 2276 | } |
| 2281 | 2277 | if (s->mv_dir & MV_DIR_BACKWARD) { |
| 2282 | 2278 | ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, |
| 2283 | − s->next_picture.f->data, | |
| 2279 | + s->next_pic.f->data, | |
| 2284 | 2280 | op_pix, op_qpix); |
| 2285 | 2281 | } |
| 2286 | 2282 | |
| @@ -2664,26 +2660,26 @@ static int sse_mb(MpegEncContext *s){ · 377 unmodified lines | ||
| 2664 | 2660 | |
| 2665 | 2661 | if(w==16 && h==16) |
| 2666 | 2662 | if(s->avctx->mb_cmp == FF_CMP_NSSE){ |
| 2667 | − return s->mecc.nsse[0](s, s->new_picture->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2663 | + return s->mecc.nsse[0](s, s->new_pic->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2668 | 2664 | s->dest[0], s->linesize, 16) + |
| 2669 | − s->mecc.nsse[1](s, s->new_picture->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2665 | + s->mecc.nsse[1](s, s->new_pic->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2670 | 2666 | s->dest[1], s->uvlinesize, chroma_mb_h) + |
| 2671 | − s->mecc.nsse[1](s, s->new_picture->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2667 | + s->mecc.nsse[1](s, s->new_pic->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2672 | 2668 | s->dest[2], s->uvlinesize, chroma_mb_h); |
| 2673 | 2669 | }else{ |
| 2674 | − return s->mecc.sse[0](NULL, s->new_picture->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2670 | + return s->mecc.sse[0](NULL, s->new_pic->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2675 | 2671 | s->dest[0], s->linesize, 16) + |
| 2676 | − s->mecc.sse[1](NULL, s->new_picture->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2672 | + s->mecc.sse[1](NULL, s->new_pic->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2677 | 2673 | s->dest[1], s->uvlinesize, chroma_mb_h) + |
| 2678 | − s->mecc.sse[1](NULL, s->new_picture->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2674 | + s->mecc.sse[1](NULL, s->new_pic->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2679 | 2675 | s->dest[2], s->uvlinesize, chroma_mb_h); |
| 2680 | 2676 | } |
| 2681 | 2677 | else |
| 2682 | − return sse(s, s->new_picture->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2678 | + return sse(s, s->new_pic->data[0] + s->mb_x * 16 + s->mb_y * s->linesize * 16, | |
| 2683 | 2679 | s->dest[0], w, h, s->linesize) + |
| 2684 | − sse(s, s->new_picture->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2680 | + sse(s, s->new_pic->data[1] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2685 | 2681 | s->dest[1], w >> s->chroma_x_shift, h >> s->chroma_y_shift, s->uvlinesize) + |
| 2686 | − sse(s, s->new_picture->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2682 | + sse(s, s->new_pic->data[2] + s->mb_x * chroma_mb_w + s->mb_y * s->uvlinesize * chroma_mb_h, | |
| 2687 | 2683 | s->dest[2], w >> s->chroma_x_shift, h >> s->chroma_y_shift, s->uvlinesize); |
| 2688 | 2684 | } |
| 2689 | 2685 | |
| @@ -2739,7 +2735,7 @@ static int mb_var_thread(AVCodecContext *c, void *arg){ · 49 unmodified lines | ||
| 2739 | 2735 | for(mb_x=0; mb_x < s->mb_width; mb_x++) { |
| 2740 | 2736 | int xx = mb_x * 16; |
| 2741 | 2737 | int yy = mb_y * 16; |
| 2742 | − const uint8_t *pix = s->new_picture->data[0] + (yy * s->linesize) + xx; | |
| 2738 | + const uint8_t *pix = s->new_pic->data[0] + (yy * s->linesize) + xx; | |
| 2743 | 2739 | int varc; |
| 2744 | 2740 | int sum = s->mpvencdsp.pix_sum(pix, s->linesize); |
| 2745 | 2741 | |
| @@ -3102,8 +3098,8 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 356 unmodified lines | ||
| 3102 | 3098 | s->mv_type = MV_TYPE_8X8; |
| 3103 | 3099 | s->mb_intra= 0; |
| 3104 | 3100 | for(i=0; i<4; i++){ |
| 3105 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0]; | |
| 3106 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1]; | |
| 3101 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0]; | |
| 3102 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1]; | |
| 3107 | 3103 | } |
| 3108 | 3104 | encode_mb_hq(s, &backup_s, &best_s, pb, pb2, tex_pb, |
| 3109 | 3105 | &dmin, &next_block, 0, 0); |
| @@ -3290,7 +3286,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 180 unmodified lines | ||
| 3290 | 3286 | } |
| 3291 | 3287 | } |
| 3292 | 3288 | |
| 3293 | − s->current_picture.qscale_table[xy] = best_s.qscale; | |
| 3289 | + s->cur_pic.qscale_table[xy] = best_s.qscale; | |
| 3294 | 3290 | |
| 3295 | 3291 | copy_context_after_encode(s, &best_s); |
| 3296 | 3292 | |
| @@ -3357,8 +3353,8 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 60 unmodified lines | ||
| 3357 | 3353 | s->mv_type = MV_TYPE_8X8; |
| 3358 | 3354 | s->mb_intra= 0; |
| 3359 | 3355 | for(i=0; i<4; i++){ |
| 3360 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0]; | |
| 3361 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1]; | |
| 3356 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0]; | |
| 3357 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1]; | |
| 3362 | 3358 | } |
| 3363 | 3359 | break; |
| 3364 | 3360 | case CANDIDATE_MB_TYPE_DIRECT: |
| @@ -3459,13 +3455,13 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 94 unmodified lines | ||
| 3459 | 3455 | if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16; |
| 3460 | 3456 | |
| 3461 | 3457 | s->encoding_error[0] += sse( |
| 3462 | − s, s->new_picture->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, | |
| 3458 | + s, s->new_pic->data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, | |
| 3463 | 3459 | s->dest[0], w, h, s->linesize); |
| 3464 | 3460 | s->encoding_error[1] += sse( |
| 3465 | − s, s->new_picture->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, | |
| 3461 | + s, s->new_pic->data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, | |
| 3466 | 3462 | s->dest[1], w>>1, h>>s->chroma_y_shift, s->uvlinesize); |
| 3467 | 3463 | s->encoding_error[2] += sse( |
| 3468 | − s, s->new_picture->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, | |
| 3464 | + s, s->new_pic->data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*chr_h, | |
| 3469 | 3465 | s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize); |
| 3470 | 3466 | } |
| 3471 | 3467 | if(s->loop_filter){ |
| @@ -3522,14 +3518,14 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src) · 50 unmodified lines | ||
| 3522 | 3518 | |
| 3523 | 3519 | static int estimate_qp(MpegEncContext *s, int dry_run){ |
| 3524 | 3520 | if (s->next_lambda){ |
| 3525 | − s->current_picture_ptr->f->quality = | |
| 3526 | − s->current_picture.f->quality = s->next_lambda; | |
| 3521 | + s->cur_pic_ptr->f->quality = | |
| 3522 | + s->cur_pic.f->quality = s->next_lambda; | |
| 3527 | 3523 | if(!dry_run) s->next_lambda= 0; |
| 3528 | 3524 | } else if (!s->fixed_qscale) { |
| 3529 | 3525 | int quality = ff_rate_estimate_qscale(s, dry_run); |
| 3530 | − s->current_picture_ptr->f->quality = | |
| 3531 | − s->current_picture.f->quality = quality; | |
| 3532 | − if (s->current_picture.f->quality < 0) | |
| 3526 | + s->cur_pic_ptr->f->quality = | |
| 3527 | + s->cur_pic.f->quality = quality; | |
| 3528 | + if (s->cur_pic.f->quality < 0) | |
| 3533 | 3529 | return -1; |
| 3534 | 3530 | } |
| 3535 | 3531 | |
| @@ -3552,15 +3548,15 @@ static int estimate_qp(MpegEncContext *s, int dry_run){ · 16 unmodified lines | ||
| 3552 | 3548 | s->lambda= s->lambda_table[0]; |
| 3553 | 3549 | //FIXME broken |
| 3554 | 3550 | }else |
| 3555 | − s->lambda = s->current_picture.f->quality; | |
| 3551 | + s->lambda = s->cur_pic.f->quality; | |
| 3556 | 3552 | update_qscale(s); |
| 3557 | 3553 | return 0; |
| 3558 | 3554 | } |
| 3559 | 3555 | |
| 3560 | 3556 | /* must be called before writing the header */ |
| 3561 | 3557 | static void set_frame_distances(MpegEncContext * s){ |
| 3562 | − av_assert1(s->current_picture_ptr->f->pts != AV_NOPTS_VALUE); | |
| 3563 | − s->time = s->current_picture_ptr->f->pts * s->avctx->time_base.num; | |
| 3558 | + av_assert1(s->cur_pic_ptr->f->pts != AV_NOPTS_VALUE); | |
| 3559 | + s->time = s->cur_pic_ptr->f->pts * s->avctx->time_base.num; | |
| 3564 | 3560 | |
| 3565 | 3561 | if(s->pict_type==AV_PICTURE_TYPE_B){ |
| 3566 | 3562 | s->pb_time= s->pp_time - (s->last_non_b_time - s->time); |
| @@ -3591,7 +3587,7 @@ static int encode_picture(MpegEncContext *s) · 24 unmodified lines | ||
| 3591 | 3587 | |
| 3592 | 3588 | s->me.scene_change_score=0; |
| 3593 | 3589 | |
| 3594 | −// s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion | |
| 3590 | +// s->lambda= s->cur_pic_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion | |
| 3595 | 3591 | |
| 3596 | 3592 | if(s->pict_type==AV_PICTURE_TYPE_I){ |
| 3597 | 3593 | if(s->msmpeg4_version >= 3) s->no_rounding=1; |
| @@ -3781,16 +3777,16 @@ static int encode_picture(MpegEncContext *s) · 183 unmodified lines | ||
| 3781 | 3777 | |
| 3782 | 3778 | //FIXME var duplication |
| 3783 | 3779 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 3784 | − s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_KEY; //FIXME pic_ptr | |
| 3785 | − s->current_picture.f->flags |= AV_FRAME_FLAG_KEY; | |
| 3780 | + s->cur_pic_ptr->f->flags |= AV_FRAME_FLAG_KEY; //FIXME pic_ptr | |
| 3781 | + s->cur_pic.f->flags |= AV_FRAME_FLAG_KEY; | |
| 3786 | 3782 | } else { |
| 3787 | − s->current_picture_ptr->f->flags &= ~AV_FRAME_FLAG_KEY; //FIXME pic_ptr | |
| 3788 | − s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY; | |
| 3783 | + s->cur_pic_ptr->f->flags &= ~AV_FRAME_FLAG_KEY; //FIXME pic_ptr | |
| 3784 | + s->cur_pic.f->flags &= ~AV_FRAME_FLAG_KEY; | |
| 3789 | 3785 | } |
| 3790 | − s->current_picture_ptr->f->pict_type = | |
| 3791 | − s->current_picture.f->pict_type = s->pict_type; | |
| 3786 | + s->cur_pic_ptr->f->pict_type = | |
| 3787 | + s->cur_pic.f->pict_type = s->pict_type; | |
| 3792 | 3788 | |
| 3793 | − if (s->current_picture.f->flags & AV_FRAME_FLAG_KEY) | |
| 3789 | + if (s->cur_pic.f->flags & AV_FRAME_FLAG_KEY) | |
| 3794 | 3790 | s->picture_in_gop_number=0; |
| 3795 | 3791 | |
| 3796 | 3792 | s->mb_x = s->mb_y = 0; |
| @@ -93,8 +93,8 @@ void mpeg_motion_internal(MpegEncContext *s, · 92 unmodified lines | ||
| 93 | 93 | ptrdiff_t uvlinesize, linesize; |
| 94 | 94 | |
| 95 | 95 | v_edge_pos = s->v_edge_pos >> field_based; |
| 96 | − linesize = s->current_picture.f->linesize[0] << field_based; | |
| 97 | − uvlinesize = s->current_picture.f->linesize[1] << field_based; | |
| 96 | + linesize = s->cur_pic.f->linesize[0] << field_based; | |
| 97 | + uvlinesize = s->cur_pic.f->linesize[1] << field_based; | |
| 98 | 98 | block_y_half = (field_based | is_16x8); |
| 99 | 99 | |
| 100 | 100 | dxy = ((motion_y & 1) << 1) | (motion_x & 1); |
| @@ -514,7 +514,7 @@ static inline void apply_obmc(MpegEncContext *s, · 413 unmodified lines | ||
| 514 | 514 | op_pixels_func (*pix_op)[4]) |
| 515 | 515 | { |
| 516 | 516 | LOCAL_ALIGNED_8(int16_t, mv_cache, [4], [4][2]); |
| 517 | − const Picture *cur_frame = &s->current_picture; | |
| 517 | + const Picture *cur_frame = &s->cur_pic; | |
| 518 | 518 | int mb_x = s->mb_x; |
| 519 | 519 | int mb_y = s->mb_y; |
| 520 | 520 | const int xy = mb_x + mb_y * s->mb_stride; |
| @@ -749,7 +749,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 228 unmodified lines | ||
| 749 | 749 | av_assert2(s->out_format == FMT_MPEG1); |
| 750 | 750 | if (s->picture_structure != s->field_select[dir][0] + 1 && |
| 751 | 751 | s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { |
| 752 | − ref_picture = s->current_picture_ptr->f->data; | |
| 752 | + ref_picture = s->cur_pic_ptr->f->data; | |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | mpeg_motion(s, dest_y, dest_cb, dest_cr, |
| @@ -767,7 +767,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 11 unmodified lines | ||
| 767 | 767 | s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { |
| 768 | 768 | ref2picture = ref_picture; |
| 769 | 769 | } else { |
| 770 | − ref2picture = s->current_picture_ptr->f->data; | |
| 770 | + ref2picture = s->cur_pic_ptr->f->data; | |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | 773 | mpeg_motion(s, dest_y, dest_cb, dest_cr, |
| @@ -807,7 +807,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 33 unmodified lines | ||
| 807 | 807 | /* opposite parity is always in the same frame if this is |
| 808 | 808 | * second field */ |
| 809 | 809 | if (!s->first_field) |
| 810 | − ref_picture = s->current_picture_ptr->f->data; | |
| 810 | + ref_picture = s->cur_pic_ptr->f->data; | |
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | 813 | break; |
| @@ -59,7 +59,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 58 unmodified lines | ||
| 59 | 59 | #define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG1) : is_mpeg12) |
| 60 | 60 | const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; |
| 61 | 61 | |
| 62 | − s->current_picture.qscale_table[mb_xy] = s->qscale; | |
| 62 | + s->cur_pic.qscale_table[mb_xy] = s->qscale; | |
| 63 | 63 | |
| 64 | 64 | /* update DC predictors for P macroblocks */ |
| 65 | 65 | if (!s->mb_intra) { |
| @@ -82,8 +82,8 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 16 unmodified lines | ||
| 82 | 82 | { |
| 83 | 83 | uint8_t *dest_y, *dest_cb, *dest_cr; |
| 84 | 84 | int dct_linesize, dct_offset; |
| 85 | − const int linesize = s->current_picture.f->linesize[0]; //not s->linesize as this would be wrong for field pics | |
| 86 | − const int uvlinesize = s->current_picture.f->linesize[1]; | |
| 85 | + const int linesize = s->cur_pic.f->linesize[0]; //not s->linesize as this would be wrong for field pics | |
| 86 | + const int uvlinesize = s->cur_pic.f->linesize[1]; | |
| 87 | 87 | const int readable = IS_ENCODER || lowres_flag || s->pict_type != AV_PICTURE_TYPE_B; |
| 88 | 88 | const int block_size = lowres_flag ? 8 >> s->avctx->lowres : 8; |
| 89 | 89 | |
| @@ -96,7 +96,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 6 unmodified lines | ||
| 96 | 96 | s->mb_skipped = 0; |
| 97 | 97 | av_assert2(s->pict_type!=AV_PICTURE_TYPE_I); |
| 98 | 98 | *mbskip_ptr = 1; |
| 99 | − } else if(!s->current_picture.reference) { | |
| 99 | + } else if (!s->cur_pic.reference) { | |
| 100 | 100 | *mbskip_ptr = 1; |
| 101 | 101 | } else{ |
| 102 | 102 | *mbskip_ptr = 0; /* not skipped */ |
| @@ -124,11 +124,11 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 21 unmodified lines | ||
| 124 | 124 | if (HAVE_THREADS && is_mpeg12 != DEFINITELY_MPEG12 && |
| 125 | 125 | s->avctx->active_thread_type & FF_THREAD_FRAME) { |
| 126 | 126 | if (s->mv_dir & MV_DIR_FORWARD) { |
| 127 | − ff_thread_await_progress(&s->last_picture_ptr->tf, | |
| 127 | + ff_thread_await_progress(&s->last_pic_ptr->tf, | |
| 128 | 128 | lowest_referenced_row(s, 0), 0); |
| 129 | 129 | } |
| 130 | 130 | if (s->mv_dir & MV_DIR_BACKWARD) { |
| 131 | − ff_thread_await_progress(&s->next_picture_ptr->tf, | |
| 131 | + ff_thread_await_progress(&s->next_pic_ptr->tf, | |
| 132 | 132 | lowest_referenced_row(s, 1), 0); |
| 133 | 133 | } |
| 134 | 134 | } |
| @@ -137,11 +137,11 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 2 unmodified lines | ||
| 137 | 137 | const h264_chroma_mc_func *op_pix = s->h264chroma.put_h264_chroma_pixels_tab; |
| 138 | 138 | |
| 139 | 139 | if (s->mv_dir & MV_DIR_FORWARD) { |
| 140 | − MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix); | |
| 140 | + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_pic.f->data, op_pix); | |
| 141 | 141 | op_pix = s->h264chroma.avg_h264_chroma_pixels_tab; |
| 142 | 142 | } |
| 143 | 143 | if (s->mv_dir & MV_DIR_BACKWARD) { |
| 144 | − MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix); | |
| 144 | + MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_pic.f->data, op_pix); | |
| 145 | 145 | } |
| 146 | 146 | } else { |
| 147 | 147 | op_pixels_func (*op_pix)[4]; |
| @@ -155,12 +155,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 7 unmodified lines | ||
| 155 | 155 | op_qpix = s->qdsp.put_no_rnd_qpel_pixels_tab; |
| 156 | 156 | } |
| 157 | 157 | if (s->mv_dir & MV_DIR_FORWARD) { |
| 158 | − ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix); | |
| 158 | + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_pic.f->data, op_pix, op_qpix); | |
| 159 | 159 | op_pix = s->hdsp.avg_pixels_tab; |
| 160 | 160 | op_qpix = s->qdsp.avg_qpel_pixels_tab; |
| 161 | 161 | } |
| 162 | 162 | if (s->mv_dir & MV_DIR_BACKWARD) { |
| 163 | − ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix); | |
| 163 | + ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_pic.f->data, op_pix, op_qpix); | |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| @@ -282,10 +282,10 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, · 281 unmodified lines | ||
| 282 | 282 | int bs = 8 >> s->avctx->lowres; |
| 283 | 283 | if(n<4){ |
| 284 | 284 | wrap= s->linesize; |
| 285 | − dest= s->current_picture.f->data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs; | |
| 285 | + dest = s->cur_pic.f->data[0] + (((n >> 1) + 2*s->mb_y) * bs* wrap ) + ((n & 1) + 2*s->mb_x) * bs; | |
| 286 | 286 | }else{ |
| 287 | 287 | wrap= s->uvlinesize; |
| 288 | − dest= s->current_picture.f->data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs; | |
| 288 | + dest = s->cur_pic.f->data[n - 3] + (s->mb_y * bs * wrap) + s->mb_x * bs; | |
| 289 | 289 | } |
| 290 | 290 | if(s->mb_x==0) a= (1024 + (scale>>1))/scale; |
| 291 | 291 | else a= get_dc(dest-bs, wrap, scale*8>>(2*s->avctx->lowres), bs); |
| @@ -105,7 +105,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) · 104 unmodified lines | ||
| 105 | 105 | static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) |
| 106 | 106 | { |
| 107 | 107 | int cbp, code, i; |
| 108 | − uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; | |
| 108 | + uint32_t * const mb_type_ptr = &s->cur_pic.mb_type[s->mb_x + s->mb_y*s->mb_stride]; | |
| 109 | 109 | |
| 110 | 110 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 111 | 111 | if (s->use_skip_mb_code) { |
| @@ -207,7 +207,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 95 unmodified lines | ||
| 207 | 207 | { |
| 208 | 208 | int cbp, code, i; |
| 209 | 209 | uint8_t *coded_val; |
| 210 | − uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; | |
| 210 | + uint32_t * const mb_type_ptr = &s->cur_pic.mb_type[s->mb_x + s->mb_y*s->mb_stride]; | |
| 211 | 211 | |
| 212 | 212 | if (get_bits_left(&s->gb) <= 0) |
| 213 | 213 | return AVERROR_INVALIDDATA; |
| @@ -431,7 +431,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, · 430 unmodified lines | ||
| 431 | 431 | |
| 432 | 432 | ff_mpv_frame_end(s); |
| 433 | 433 | |
| 434 | − f = s->current_picture.f; | |
| 434 | + f = s->cur_pic.f; | |
| 435 | 435 | |
| 436 | 436 | if (v->respic == 3) { |
| 437 | 437 | ctx->dsp.upsample_plane(f->data[0], f->linesize[0], w, h); |
| @@ -39,7 +39,7 @@ static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer · 38 unmodified lines | ||
| 39 | 39 | CUVIDMPEG2PICPARAMS *ppc = &pp->CodecSpecific.mpeg2; |
| 40 | 40 | FrameDecodeData *fdd; |
| 41 | 41 | NVDECFrame *cf; |
| 42 | − AVFrame *cur_frame = s->current_picture.f; | |
| 42 | + AVFrame *cur_frame = s->cur_pic.f; | |
| 43 | 43 | |
| 44 | 44 | int ret, i; |
| 45 | 45 | |
| @@ -64,8 +64,8 @@ static int nvdec_mpeg12_start_frame(AVCodecContext *avctx, const uint8_t *buffer · 18 unmodified lines | ||
| 64 | 64 | s->pict_type == AV_PICTURE_TYPE_P, |
| 65 | 65 | |
| 66 | 66 | .CodecSpecific.mpeg2 = { |
| 67 | − .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_picture.f), | |
| 68 | − .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_picture.f), | |
| 67 | + .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_pic.f), | |
| 68 | + .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_pic.f), | |
| 69 | 69 | |
| 70 | 70 | .picture_coding_type = s->pict_type, |
| 71 | 71 | .full_pel_forward_vector = s->full_pel[0], |
| @@ -38,7 +38,7 @@ static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, · 37 unmodified lines | ||
| 38 | 38 | CUVIDMPEG4PICPARAMS *ppc = &pp->CodecSpecific.mpeg4; |
| 39 | 39 | FrameDecodeData *fdd; |
| 40 | 40 | NVDECFrame *cf; |
| 41 | − AVFrame *cur_frame = s->current_picture.f; | |
| 41 | + AVFrame *cur_frame = s->cur_pic.f; | |
| 42 | 42 | |
| 43 | 43 | int ret, i; |
| 44 | 44 | |
| @@ -60,8 +60,8 @@ static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, · 15 unmodified lines | ||
| 60 | 60 | s->pict_type == AV_PICTURE_TYPE_S, |
| 61 | 61 | |
| 62 | 62 | .CodecSpecific.mpeg4 = { |
| 63 | − .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_picture.f), | |
| 64 | − .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_picture.f), | |
| 63 | + .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_pic.f), | |
| 64 | + .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_pic.f), | |
| 65 | 65 | |
| 66 | 66 | .video_object_layer_width = s->width, |
| 67 | 67 | .video_object_layer_height = s->height, |
| @@ -38,7 +38,7 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u · 37 unmodified lines | ||
| 38 | 38 | CUVIDPICPARAMS *pp = &ctx->pic_params; |
| 39 | 39 | FrameDecodeData *fdd; |
| 40 | 40 | NVDECFrame *cf; |
| 41 | − AVFrame *cur_frame = s->current_picture.f; | |
| 41 | + AVFrame *cur_frame = s->cur_pic.f; | |
| 42 | 42 | |
| 43 | 43 | int ret; |
| 44 | 44 | |
| @@ -63,8 +63,8 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u · 18 unmodified lines | ||
| 63 | 63 | s->pict_type == AV_PICTURE_TYPE_P, |
| 64 | 64 | |
| 65 | 65 | .CodecSpecific.vc1 = { |
| 66 | − .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_picture.f), | |
| 67 | − .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_picture.f), | |
| 66 | + .ForwardRefIdx = ff_nvdec_get_ref_idx(s->last_pic.f), | |
| 67 | + .BackwardRefIdx = ff_nvdec_get_ref_idx(s->next_pic.f), | |
| 68 | 68 | .FrameWidth = cur_frame->width, |
| 69 | 69 | .FrameHeight = cur_frame->height, |
| 70 | 70 | |
| @@ -40,10 +40,10 @@ void ff_write_pass1_stats(MpegEncContext *s) · 39 unmodified lines | ||
| 40 | 40 | snprintf(s->avctx->stats_out, 256, |
| 41 | 41 | "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d " |
| 42 | 42 | "fcode:%d bcode:%d mc-var:%"PRId64" var:%"PRId64" icount:%d hbits:%d;\n", |
| 43 | − s->current_picture_ptr->display_picture_number, | |
| 44 | − s->current_picture_ptr->coded_picture_number, | |
| 43 | + s->cur_pic_ptr->display_picture_number, | |
| 44 | + s->cur_pic_ptr->coded_picture_number, | |
| 45 | 45 | s->pict_type, |
| 46 | − s->current_picture.f->quality, | |
| 46 | + s->cur_pic.f->quality, | |
| 47 | 47 | s->i_tex_bits, |
| 48 | 48 | s->p_tex_bits, |
| 49 | 49 | s->mv_bits, |
| @@ -936,9 +936,9 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) · 886 unmodified lines | ||
| 936 | 936 | * here instead of reordering but the reordering is simpler for now |
| 937 | 937 | * until H.264 B-pyramid must be handled. */ |
| 938 | 938 | if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) |
| 939 | − dts_pic = s->current_picture_ptr; | |
| 939 | + dts_pic = s->cur_pic_ptr; | |
| 940 | 940 | else |
| 941 | − dts_pic = s->last_picture_ptr; | |
| 941 | + dts_pic = s->last_pic_ptr; | |
| 942 | 942 | |
| 943 | 943 | if (!dts_pic || dts_pic->f->pts == AV_NOPTS_VALUE) |
| 944 | 944 | wanted_bits = (uint64_t)(s->bit_rate * (double)picture_number / fps); |
| @@ -170,7 +170,7 @@ static int rv20_decode_picture_header(RVDecContext *rv, int whole_size) · 169 unmodified lines | ||
| 170 | 170 | av_log(s->avctx, AV_LOG_ERROR, "low delay B\n"); |
| 171 | 171 | return -1; |
| 172 | 172 | } |
| 173 | − if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) { | |
| 173 | + if (!s->last_pic_ptr && s->pict_type == AV_PICTURE_TYPE_B) { | |
| 174 | 174 | av_log(s->avctx, AV_LOG_ERROR, "early B-frame\n"); |
| 175 | 175 | return AVERROR_INVALIDDATA; |
| 176 | 176 | } |
| @@ -458,9 +458,9 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, · 281 unmodified lines | ||
| 458 | 458 | if (whole_size < s->mb_width * s->mb_height / 8) |
| 459 | 459 | return AVERROR_INVALIDDATA; |
| 460 | 460 | |
| 461 | − if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) { | |
| 461 | + if ((s->mb_x == 0 && s->mb_y == 0) || !s->cur_pic_ptr) { | |
| 462 | 462 | // FIXME write parser so we always have complete frames? |
| 463 | − if (s->current_picture_ptr) { | |
| 463 | + if (s->cur_pic_ptr) { | |
| 464 | 464 | ff_er_frame_end(&s->er, NULL); |
| 465 | 465 | ff_mpv_frame_end(s); |
| 466 | 466 | s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0; |
| @@ -469,7 +469,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, · 2 unmodified lines | ||
| 469 | 469 | return ret; |
| 470 | 470 | ff_mpeg_er_frame_start(s); |
| 471 | 471 | } else { |
| 472 | − if (s->current_picture_ptr->f->pict_type != s->pict_type) { | |
| 472 | + if (s->cur_pic_ptr->f->pict_type != s->pict_type) { | |
| 473 | 473 | av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n"); |
| 474 | 474 | return AVERROR_INVALIDDATA; |
| 475 | 475 | } |
| @@ -632,28 +632,28 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 156 unmodified lines | ||
| 632 | 632 | i++; |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | − if (s->current_picture_ptr && s->mb_y >= s->mb_height) { | |
| 635 | + if (s->cur_pic_ptr && s->mb_y >= s->mb_height) { | |
| 636 | 636 | ff_er_frame_end(&s->er, NULL); |
| 637 | 637 | ff_mpv_frame_end(s); |
| 638 | 638 | |
| 639 | 639 | if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { |
| 640 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 640 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 641 | 641 | return ret; |
| 642 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 643 | − ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 644 | − } else if (s->last_picture_ptr) { | |
| 645 | − if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) | |
| 642 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 643 | + ff_mpv_export_qp_table(s, pict, s->cur_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 644 | + } else if (s->last_pic_ptr) { | |
| 645 | + if ((ret = av_frame_ref(pict, s->last_pic_ptr->f)) < 0) | |
| 646 | 646 | return ret; |
| 647 | − ff_print_debug_info(s, s->last_picture_ptr, pict); | |
| 648 | − ff_mpv_export_qp_table(s, pict,s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 647 | + ff_print_debug_info(s, s->last_pic_ptr, pict); | |
| 648 | + ff_mpv_export_qp_table(s, pict,s->last_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | − if (s->last_picture_ptr || s->low_delay) { | |
| 651 | + if (s->last_pic_ptr || s->low_delay) { | |
| 652 | 652 | *got_frame = 1; |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | // so we can detect if frame_end was not called (find some nicer solution...) |
| 656 | − s->current_picture_ptr = NULL; | |
| 656 | + s->cur_pic_ptr = NULL; | |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | return avpkt->size; |
| @@ -160,7 +160,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 159 unmodified lines | ||
| 160 | 160 | |
| 161 | 161 | mb_pos = row * s->mb_stride; |
| 162 | 162 | for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ |
| 163 | − int mbtype = s->current_picture_ptr->mb_type[mb_pos]; | |
| 163 | + int mbtype = s->cur_pic_ptr->mb_type[mb_pos]; | |
| 164 | 164 | if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype)) |
| 165 | 165 | r->deblock_coefs[mb_pos] = 0xFFFF; |
| 166 | 166 | if(IS_INTRA(mbtype)) |
| @@ -172,11 +172,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 5 unmodified lines | ||
| 172 | 172 | */ |
| 173 | 173 | mb_pos = row * s->mb_stride; |
| 174 | 174 | for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ |
| 175 | − cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; | |
| 175 | + cur_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos]]; | |
| 176 | 176 | if(mb_x) |
| 177 | − left_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - 1]]; | |
| 177 | + left_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos - 1]]; | |
| 178 | 178 | for(j = 0; j < 16; j += 4){ |
| 179 | − Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x; | |
| 179 | + Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x; | |
| 180 | 180 | for(i = !mb_x; i < 4; i++, Y += 4){ |
| 181 | 181 | int ij = i + j; |
| 182 | 182 | loc_lim = 0; |
| @@ -196,7 +196,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 13 unmodified lines | ||
| 196 | 196 | if(mb_x) |
| 197 | 197 | left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF; |
| 198 | 198 | for(j = 0; j < 8; j += 4){ |
| 199 | − C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x; | |
| 199 | + C = s->cur_pic_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x; | |
| 200 | 200 | for(i = !mb_x; i < 2; i++, C += 4){ |
| 201 | 201 | int ij = i + (j >> 1); |
| 202 | 202 | loc_lim = 0; |
| @@ -214,11 +214,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 11 unmodified lines | ||
| 214 | 214 | } |
| 215 | 215 | mb_pos = row * s->mb_stride; |
| 216 | 216 | for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ |
| 217 | − cur_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos]]; | |
| 217 | + cur_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos]]; | |
| 218 | 218 | if(row) |
| 219 | − top_lim = rv30_loop_filt_lim[s->current_picture_ptr->qscale_table[mb_pos - s->mb_stride]]; | |
| 219 | + top_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos - s->mb_stride]]; | |
| 220 | 220 | for(j = 4*!row; j < 16; j += 4){ |
| 221 | − Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; | |
| 221 | + Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; | |
| 222 | 222 | for(i = 0; i < 4; i++, Y += 4){ |
| 223 | 223 | int ij = i + j; |
| 224 | 224 | loc_lim = 0; |
| @@ -238,7 +238,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 13 unmodified lines | ||
| 238 | 238 | if(row) |
| 239 | 239 | top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF; |
| 240 | 240 | for(j = 4*!row; j < 8; j += 4){ |
| 241 | − C = s->current_picture_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize; | |
| 241 | + C = s->cur_pic_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize; | |
| 242 | 242 | for(i = 0; i < 2; i++, C += 4){ |
| 243 | 243 | int ij = i + (j >> 1); |
| 244 | 244 | loc_lim = 0; |
| @@ -369,7 +369,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) · 368 unmodified lines | ||
| 369 | 369 | |
| 370 | 370 | r->is16 = get_bits1(gb); |
| 371 | 371 | if(r->is16){ |
| 372 | − s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA16x16; | |
| 372 | + s->cur_pic_ptr->mb_type[mb_pos] = MB_TYPE_INTRA16x16; | |
| 373 | 373 | r->block_type = RV34_MB_TYPE_INTRA16x16; |
| 374 | 374 | t = get_bits(gb, 2); |
| 375 | 375 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); |
| @@ -379,7 +379,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) · 3 unmodified lines | ||
| 379 | 379 | if(!get_bits1(gb)) |
| 380 | 380 | av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n"); |
| 381 | 381 | } |
| 382 | − s->current_picture_ptr->mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 382 | + s->cur_pic_ptr->mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 383 | 383 | r->block_type = RV34_MB_TYPE_INTRA; |
| 384 | 384 | if(r->decode_intra_types(r, gb, intra_types) < 0) |
| 385 | 385 | return -1; |
| @@ -405,7 +405,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 19 unmodified lines | ||
| 405 | 405 | r->block_type = r->decode_mb_info(r); |
| 406 | 406 | if(r->block_type == -1) |
| 407 | 407 | return -1; |
| 408 | − s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; | |
| 408 | + s->cur_pic_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; | |
| 409 | 409 | r->mb_type[mb_pos] = r->block_type; |
| 410 | 410 | if(r->block_type == RV34_MB_SKIP){ |
| 411 | 411 | if(s->pict_type == AV_PICTURE_TYPE_P) |
| @@ -413,7 +413,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 1 unmodified line | ||
| 413 | 413 | if(s->pict_type == AV_PICTURE_TYPE_B) |
| 414 | 414 | r->mb_type[mb_pos] = RV34_MB_B_DIRECT; |
| 415 | 415 | } |
| 416 | − r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]); | |
| 416 | + r->is16 = !!IS_INTRA16x16(s->cur_pic_ptr->mb_type[mb_pos]); | |
| 417 | 417 | if (rv34_decode_mv(r, r->block_type) < 0) |
| 418 | 418 | return -1; |
| 419 | 419 | if(r->block_type == RV34_MB_SKIP){ |
| @@ -423,7 +423,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 3 unmodified lines | ||
| 423 | 423 | r->chroma_vlc = 1; |
| 424 | 424 | r->luma_vlc = 0; |
| 425 | 425 | |
| 426 | − if(IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){ | |
| 426 | + if(IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){ | |
| 427 | 427 | if(r->is16){ |
| 428 | 428 | t = get_bits(gb, 2); |
| 429 | 429 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); |
| @@ -488,27 +488,27 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int · 58 unmodified lines | ||
| 488 | 488 | c_off = -1; |
| 489 | 489 | |
| 490 | 490 | if(avail[-1]){ |
| 491 | − A[0] = s->current_picture_ptr->motion_val[0][mv_pos-1][0]; | |
| 492 | − A[1] = s->current_picture_ptr->motion_val[0][mv_pos-1][1]; | |
| 491 | + A[0] = s->cur_pic_ptr->motion_val[0][mv_pos-1][0]; | |
| 492 | + A[1] = s->cur_pic_ptr->motion_val[0][mv_pos-1][1]; | |
| 493 | 493 | } |
| 494 | 494 | if(avail[-4]){ |
| 495 | − B[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][0]; | |
| 496 | − B[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][1]; | |
| 495 | + B[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][0]; | |
| 496 | + B[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][1]; | |
| 497 | 497 | }else{ |
| 498 | 498 | B[0] = A[0]; |
| 499 | 499 | B[1] = A[1]; |
| 500 | 500 | } |
| 501 | 501 | if(!avail[c_off-4]){ |
| 502 | 502 | if(avail[-4] && (avail[-1] || r->rv30)){ |
| 503 | − C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][0]; | |
| 504 | − C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][1]; | |
| 503 | + C[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride-1][0]; | |
| 504 | + C[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride-1][1]; | |
| 505 | 505 | }else{ |
| 506 | 506 | C[0] = A[0]; |
| 507 | 507 | C[1] = A[1]; |
| 508 | 508 | } |
| 509 | 509 | }else{ |
| 510 | − C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][0]; | |
| 511 | − C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][1]; | |
| 510 | + C[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][0]; | |
| 511 | + C[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][1]; | |
| 512 | 512 | } |
| 513 | 513 | mx = mid_pred(A[0], B[0], C[0]); |
| 514 | 514 | my = mid_pred(A[1], B[1], C[1]); |
| @@ -516,8 +516,8 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int · 1 unmodified line | ||
| 516 | 516 | my += r->dmv[dmv_no][1]; |
| 517 | 517 | for(j = 0; j < part_sizes_h[block_type]; j++){ |
| 518 | 518 | for(i = 0; i < part_sizes_w[block_type]; i++){ |
| 519 | − s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][0] = mx; | |
| 520 | − s->current_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my; | |
| 519 | + s->cur_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][0] = mx; | |
| 520 | + s->cur_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my; | |
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | } |
| @@ -566,7 +566,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) · 42 unmodified lines | ||
| 566 | 566 | int has_A = 0, has_B = 0, has_C = 0; |
| 567 | 567 | int mx, my; |
| 568 | 568 | int i, j; |
| 569 | − Picture *cur_pic = s->current_picture_ptr; | |
| 569 | + Picture *cur_pic = s->cur_pic_ptr; | |
| 570 | 570 | const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; |
| 571 | 571 | int type = cur_pic->mb_type[mb_pos]; |
| 572 | 572 | |
| @@ -619,27 +619,27 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) · 46 unmodified lines | ||
| 619 | 619 | int* avail = r->avail_cache + avail_indexes[0]; |
| 620 | 620 | |
| 621 | 621 | if(avail[-1]){ |
| 622 | − A[0] = s->current_picture_ptr->motion_val[0][mv_pos - 1][0]; | |
| 623 | − A[1] = s->current_picture_ptr->motion_val[0][mv_pos - 1][1]; | |
| 622 | + A[0] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][0]; | |
| 623 | + A[1] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][1]; | |
| 624 | 624 | } |
| 625 | 625 | if(avail[-4]){ |
| 626 | − B[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][0]; | |
| 627 | − B[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][1]; | |
| 626 | + B[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride][0]; | |
| 627 | + B[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride][1]; | |
| 628 | 628 | }else{ |
| 629 | 629 | B[0] = A[0]; |
| 630 | 630 | B[1] = A[1]; |
| 631 | 631 | } |
| 632 | 632 | if(!avail[-4 + 2]){ |
| 633 | 633 | if(avail[-4] && (avail[-1])){ |
| 634 | − C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][0]; | |
| 635 | − C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride - 1][1]; | |
| 634 | + C[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride - 1][0]; | |
| 635 | + C[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride - 1][1]; | |
| 636 | 636 | }else{ |
| 637 | 637 | C[0] = A[0]; |
| 638 | 638 | C[1] = A[1]; |
| 639 | 639 | } |
| 640 | 640 | }else{ |
| 641 | − C[0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][0]; | |
| 642 | − C[1] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride + 2][1]; | |
| 641 | + C[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride + 2][0]; | |
| 642 | + C[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride + 2][1]; | |
| 643 | 643 | } |
| 644 | 644 | mx = mid_pred(A[0], B[0], C[0]); |
| 645 | 645 | my = mid_pred(A[1], B[1], C[1]); |
| @@ -648,8 +648,8 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) · 2 unmodified lines | ||
| 648 | 648 | for(j = 0; j < 2; j++){ |
| 649 | 649 | for(i = 0; i < 2; i++){ |
| 650 | 650 | for(k = 0; k < 2; k++){ |
| 651 | − s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; | |
| 652 | − s->current_picture_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; | |
| 651 | + s->cur_pic_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; | |
| 652 | + s->cur_pic_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; | |
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | } |
| @@ -688,24 +688,24 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 32 unmodified lines | ||
| 688 | 688 | |
| 689 | 689 | if(thirdpel){ |
| 690 | 690 | int chroma_mx, chroma_my; |
| 691 | − mx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24); | |
| 692 | − my = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24); | |
| 693 | − lx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3; | |
| 694 | − ly = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3; | |
| 695 | − chroma_mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2; | |
| 696 | − chroma_my = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2; | |
| 691 | + mx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24); | |
| 692 | + my = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24); | |
| 693 | + lx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3; | |
| 694 | + ly = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3; | |
| 695 | + chroma_mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2; | |
| 696 | + chroma_my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2; | |
| 697 | 697 | umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24); |
| 698 | 698 | umy = (chroma_my + (3 << 24)) / 3 - (1 << 24); |
| 699 | 699 | uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3]; |
| 700 | 700 | uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3]; |
| 701 | 701 | }else{ |
| 702 | 702 | int cx, cy; |
| 703 | − mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2; | |
| 704 | − my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2; | |
| 705 | − lx = s->current_picture_ptr->motion_val[dir][mv_pos][0] & 3; | |
| 706 | − ly = s->current_picture_ptr->motion_val[dir][mv_pos][1] & 3; | |
| 707 | − cx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 2; | |
| 708 | − cy = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 2; | |
| 703 | + mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] >> 2; | |
| 704 | + my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] >> 2; | |
| 705 | + lx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] & 3; | |
| 706 | + ly = s->cur_pic_ptr->motion_val[dir][mv_pos][1] & 3; | |
| 707 | + cx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2; | |
| 708 | + cy = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2; | |
| 709 | 709 | umx = cx >> 2; |
| 710 | 710 | umy = cy >> 2; |
| 711 | 711 | uvmx = (cx & 3) << 1; |
| @@ -718,14 +718,14 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 6 unmodified lines | ||
| 718 | 718 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) { |
| 719 | 719 | /* wait for the referenced mb row to be finished */ |
| 720 | 720 | int mb_row = s->mb_y + ((yoff + my + 5 + 8 * height) >> 4); |
| 721 | − const ThreadFrame *f = dir ? &s->next_picture_ptr->tf : &s->last_picture_ptr->tf; | |
| 721 | + const ThreadFrame *f = dir ? &s->next_pic_ptr->tf : &s->last_pic_ptr->tf; | |
| 722 | 722 | ff_thread_await_progress(f, mb_row, 0); |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | dxy = ly*4 + lx; |
| 726 | − srcY = dir ? s->next_picture_ptr->f->data[0] : s->last_picture_ptr->f->data[0]; | |
| 727 | − srcU = dir ? s->next_picture_ptr->f->data[1] : s->last_picture_ptr->f->data[1]; | |
| 728 | − srcV = dir ? s->next_picture_ptr->f->data[2] : s->last_picture_ptr->f->data[2]; | |
| 726 | + srcY = dir ? s->next_pic_ptr->f->data[0] : s->last_pic_ptr->f->data[0]; | |
| 727 | + srcU = dir ? s->next_pic_ptr->f->data[1] : s->last_pic_ptr->f->data[1]; | |
| 728 | + srcV = dir ? s->next_pic_ptr->f->data[2] : s->last_pic_ptr->f->data[2]; | |
| 729 | 729 | src_x = s->mb_x * 16 + xoff + mx; |
| 730 | 730 | src_y = s->mb_y * 16 + yoff + my; |
| 731 | 731 | uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx; |
| @@ -886,11 +886,11 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 154 unmodified lines | ||
| 886 | 886 | switch(block_type){ |
| 887 | 887 | case RV34_MB_TYPE_INTRA: |
| 888 | 888 | case RV34_MB_TYPE_INTRA16x16: |
| 889 | − ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 889 | + ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 890 | 890 | return 0; |
| 891 | 891 | case RV34_MB_SKIP: |
| 892 | 892 | if(s->pict_type == AV_PICTURE_TYPE_P){ |
| 893 | − ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 893 | + ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 894 | 894 | rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); |
| 895 | 895 | break; |
| 896 | 896 | } |
| @@ -898,23 +898,23 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 1 unmodified line | ||
| 898 | 898 | //surprisingly, it uses motion scheme from next reference frame |
| 899 | 899 | /* wait for the current mb row to be finished */ |
| 900 | 900 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
| 901 | − ff_thread_await_progress(&s->next_picture_ptr->tf, FFMAX(0, s->mb_y-1), 0); | |
| 901 | + ff_thread_await_progress(&s->next_pic_ptr->tf, FFMAX(0, s->mb_y-1), 0); | |
| 902 | 902 | |
| 903 | − next_bt = s->next_picture_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride]; | |
| 903 | + next_bt = s->next_pic_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride]; | |
| 904 | 904 | if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){ |
| 905 | − ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 906 | − ZERO8x2(s->current_picture_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 905 | + ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 906 | + ZERO8x2(s->cur_pic_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 907 | 907 | }else |
| 908 | 908 | for(j = 0; j < 2; j++) |
| 909 | 909 | for(i = 0; i < 2; i++) |
| 910 | 910 | for(k = 0; k < 2; k++) |
| 911 | 911 | for(l = 0; l < 2; l++) |
| 912 | − s->current_picture_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]); | |
| 912 | + s->cur_pic_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]); | |
| 913 | 913 | if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC |
| 914 | 914 | rv34_mc_2mv(r, block_type); |
| 915 | 915 | else |
| 916 | 916 | rv34_mc_2mv_skip(r); |
| 917 | − ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 917 | + ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | |
| 918 | 918 | break; |
| 919 | 919 | case RV34_MB_P_16x16: |
| 920 | 920 | case RV34_MB_P_MIX16x16: |
| @@ -1182,7 +1182,7 @@ static int rv34_set_deblock_coef(RV34DecContext *r) · 261 unmodified lines | ||
| 1182 | 1182 | MpegEncContext *s = &r->s; |
| 1183 | 1183 | int hmvmask = 0, vmvmask = 0, i, j; |
| 1184 | 1184 | int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride; |
| 1185 | − int16_t (*motion_val)[2] = &s->current_picture_ptr->motion_val[0][midx]; | |
| 1185 | + int16_t (*motion_val)[2] = &s->cur_pic_ptr->motion_val[0][midx]; | |
| 1186 | 1186 | for(j = 0; j < 16; j += 8){ |
| 1187 | 1187 | for(i = 0; i < 2; i++){ |
| 1188 | 1188 | if(is_mv_diff_gt_3(motion_val + i, 1)) |
| @@ -1225,26 +1225,26 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) · 36 unmodified lines | ||
| 1225 | 1225 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; |
| 1226 | 1226 | if(s->mb_x && dist) |
| 1227 | 1227 | r->avail_cache[5] = |
| 1228 | − r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1]; | |
| 1228 | + r->avail_cache[9] = s->cur_pic_ptr->mb_type[mb_pos - 1]; | |
| 1229 | 1229 | if(dist >= s->mb_width) |
| 1230 | 1230 | r->avail_cache[2] = |
| 1231 | − r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride]; | |
| 1231 | + r->avail_cache[3] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride]; | |
| 1232 | 1232 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) |
| 1233 | − r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1]; | |
| 1233 | + r->avail_cache[4] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride + 1]; | |
| 1234 | 1234 | if(s->mb_x && dist > s->mb_width) |
| 1235 | − r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1]; | |
| 1235 | + r->avail_cache[1] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride - 1]; | |
| 1236 | 1236 | |
| 1237 | 1237 | s->qscale = r->si.quant; |
| 1238 | 1238 | cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types); |
| 1239 | 1239 | r->cbp_luma [mb_pos] = cbp; |
| 1240 | 1240 | r->cbp_chroma[mb_pos] = cbp >> 16; |
| 1241 | 1241 | r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos]; |
| 1242 | − s->current_picture_ptr->qscale_table[mb_pos] = s->qscale; | |
| 1242 | + s->cur_pic_ptr->qscale_table[mb_pos] = s->qscale; | |
| 1243 | 1243 | |
| 1244 | 1244 | if(cbp == -1) |
| 1245 | 1245 | return -1; |
| 1246 | 1246 | |
| 1247 | − if (IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){ | |
| 1247 | + if (IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){ | |
| 1248 | 1248 | if(r->is16) rv34_output_i16x16(r, intra_types, cbp); |
| 1249 | 1249 | else rv34_output_intra(r, intra_types, cbp); |
| 1250 | 1250 | return 0; |
| @@ -1327,21 +1327,21 @@ static int rv34_decode_intra_macroblock(RV34DecContext *r, int8_t *intra_types) · 76 unmodified lines | ||
| 1327 | 1327 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; |
| 1328 | 1328 | if(s->mb_x && dist) |
| 1329 | 1329 | r->avail_cache[5] = |
| 1330 | − r->avail_cache[9] = s->current_picture_ptr->mb_type[mb_pos - 1]; | |
| 1330 | + r->avail_cache[9] = s->cur_pic_ptr->mb_type[mb_pos - 1]; | |
| 1331 | 1331 | if(dist >= s->mb_width) |
| 1332 | 1332 | r->avail_cache[2] = |
| 1333 | − r->avail_cache[3] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride]; | |
| 1333 | + r->avail_cache[3] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride]; | |
| 1334 | 1334 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) |
| 1335 | − r->avail_cache[4] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride + 1]; | |
| 1335 | + r->avail_cache[4] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride + 1]; | |
| 1336 | 1336 | if(s->mb_x && dist > s->mb_width) |
| 1337 | − r->avail_cache[1] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1]; | |
| 1337 | + r->avail_cache[1] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride - 1]; | |
| 1338 | 1338 | |
| 1339 | 1339 | s->qscale = r->si.quant; |
| 1340 | 1340 | cbp = rv34_decode_intra_mb_header(r, intra_types); |
| 1341 | 1341 | r->cbp_luma [mb_pos] = cbp; |
| 1342 | 1342 | r->cbp_chroma[mb_pos] = cbp >> 16; |
| 1343 | 1343 | r->deblock_coefs[mb_pos] = 0xFFFF; |
| 1344 | − s->current_picture_ptr->qscale_table[mb_pos] = s->qscale; | |
| 1344 | + s->cur_pic_ptr->qscale_table[mb_pos] = s->qscale; | |
| 1345 | 1345 | |
| 1346 | 1346 | if(cbp == -1) |
| 1347 | 1347 | return -1; |
| @@ -1482,7 +1482,7 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int · 134 unmodified lines | ||
| 1482 | 1482 | r->loop_filter(r, s->mb_y - 2); |
| 1483 | 1483 | |
| 1484 | 1484 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
| 1485 | − ff_thread_report_progress(&s->current_picture_ptr->tf, | |
| 1485 | + ff_thread_report_progress(&s->cur_pic_ptr->tf, | |
| 1486 | 1486 | s->mb_y - 2, 0); |
| 1487 | 1487 | |
| 1488 | 1488 | } |
| @@ -1580,19 +1580,19 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict) · 91 unmodified lines | ||
| 1580 | 1580 | s->mb_num_left = 0; |
| 1581 | 1581 | |
| 1582 | 1582 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
| 1583 | − ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); | |
| 1583 | + ff_thread_report_progress(&s->cur_pic_ptr->tf, INT_MAX, 0); | |
| 1584 | 1584 | |
| 1585 | 1585 | if (s->pict_type == AV_PICTURE_TYPE_B) { |
| 1586 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 1586 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 1587 | 1587 | return ret; |
| 1588 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 1589 | − ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 1588 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 1589 | + ff_mpv_export_qp_table(s, pict, s->cur_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 1590 | 1590 | got_picture = 1; |
| 1591 | − } else if (s->last_picture_ptr) { | |
| 1592 | − if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) | |
| 1591 | + } else if (s->last_pic_ptr) { | |
| 1592 | + if ((ret = av_frame_ref(pict, s->last_pic_ptr->f)) < 0) | |
| 1593 | 1593 | return ret; |
| 1594 | − ff_print_debug_info(s, s->last_picture_ptr, pict); | |
| 1595 | − ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 1594 | + ff_print_debug_info(s, s->last_pic_ptr, pict); | |
| 1595 | + ff_mpv_export_qp_table(s, pict, s->last_pic_ptr, FF_MPV_QSCALE_TYPE_MPEG1); | |
| 1596 | 1596 | got_picture = 1; |
| 1597 | 1597 | } |
| 1598 | 1598 | |
| @@ -1627,10 +1627,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 28 unmodified lines | ||
| 1627 | 1627 | /* no supplementary picture */ |
| 1628 | 1628 | if (buf_size == 0) { |
| 1629 | 1629 | /* special case for last picture */ |
| 1630 | − if (s->next_picture_ptr) { | |
| 1631 | − if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) | |
| 1630 | + if (s->next_pic_ptr) { | |
| 1631 | + if ((ret = av_frame_ref(pict, s->next_pic_ptr->f)) < 0) | |
| 1632 | 1632 | return ret; |
| 1633 | − s->next_picture_ptr = NULL; | |
| 1633 | + s->next_pic_ptr = NULL; | |
| 1634 | 1634 | |
| 1635 | 1635 | *got_picture_ptr = 1; |
| 1636 | 1636 | } |
| @@ -1653,7 +1653,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 16 unmodified lines | ||
| 1653 | 1653 | av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); |
| 1654 | 1654 | return AVERROR_INVALIDDATA; |
| 1655 | 1655 | } |
| 1656 | − if ((!s->last_picture_ptr || !s->last_picture_ptr->f->data[0]) && | |
| 1656 | + if ((!s->last_pic_ptr || !s->last_pic_ptr->f->data[0]) && | |
| 1657 | 1657 | si.type == AV_PICTURE_TYPE_B) { |
| 1658 | 1658 | av_log(avctx, AV_LOG_ERROR, "Invalid decoder state: B-frame without " |
| 1659 | 1659 | "reference data.\n"); |
| @@ -1666,7 +1666,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 6 unmodified lines | ||
| 1666 | 1666 | |
| 1667 | 1667 | /* first slice */ |
| 1668 | 1668 | if (si.start == 0) { |
| 1669 | − if (s->mb_num_left > 0 && s->current_picture_ptr) { | |
| 1669 | + if (s->mb_num_left > 0 && s->cur_pic_ptr) { | |
| 1670 | 1670 | av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n", |
| 1671 | 1671 | s->mb_num_left); |
| 1672 | 1672 | if (!s->context_reinit) |
| @@ -1791,7 +1791,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 118 unmodified lines | ||
| 1791 | 1791 | break; |
| 1792 | 1792 | } |
| 1793 | 1793 | |
| 1794 | − if (s->current_picture_ptr) { | |
| 1794 | + if (s->cur_pic_ptr) { | |
| 1795 | 1795 | if (last) { |
| 1796 | 1796 | if(r->loop_filter) |
| 1797 | 1797 | r->loop_filter(r, s->mb_height - 1); |
| @@ -1808,7 +1808,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 10 unmodified lines | ||
| 1808 | 1808 | ff_er_frame_end(&s->er, NULL); |
| 1809 | 1809 | ff_mpv_frame_end(s); |
| 1810 | 1810 | s->mb_num_left = 0; |
| 1811 | − ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); | |
| 1811 | + ff_thread_report_progress(&s->cur_pic_ptr->tf, INT_MAX, 0); | |
| 1812 | 1812 | return AVERROR_INVALIDDATA; |
| 1813 | 1813 | } |
| 1814 | 1814 | } |
| @@ -371,7 +371,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 370 unmodified lines | ||
| 371 | 371 | |
| 372 | 372 | mb_pos = row * s->mb_stride; |
| 373 | 373 | for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ |
| 374 | − int mbtype = s->current_picture_ptr->mb_type[mb_pos]; | |
| 374 | + int mbtype = s->cur_pic_ptr->mb_type[mb_pos]; | |
| 375 | 375 | if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype)) |
| 376 | 376 | r->cbp_luma [mb_pos] = r->deblock_coefs[mb_pos] = 0xFFFF; |
| 377 | 377 | if(IS_INTRA(mbtype)) |
| @@ -386,7 +386,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 8 unmodified lines | ||
| 386 | 386 | unsigned y_to_deblock; |
| 387 | 387 | int c_to_deblock[2]; |
| 388 | 388 | |
| 389 | − q = s->current_picture_ptr->qscale_table[mb_pos]; | |
| 389 | + q = s->cur_pic_ptr->qscale_table[mb_pos]; | |
| 390 | 390 | alpha = rv40_alpha_tab[q]; |
| 391 | 391 | beta = rv40_beta_tab [q]; |
| 392 | 392 | betaY = betaC = beta * 3; |
| @@ -401,7 +401,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 8 unmodified lines | ||
| 401 | 401 | if(avail[i]){ |
| 402 | 402 | int pos = mb_pos + neighbour_offs_x[i] + neighbour_offs_y[i]*s->mb_stride; |
| 403 | 403 | mvmasks[i] = r->deblock_coefs[pos]; |
| 404 | − mbtype [i] = s->current_picture_ptr->mb_type[pos]; | |
| 404 | + mbtype [i] = s->cur_pic_ptr->mb_type[pos]; | |
| 405 | 405 | cbp [i] = r->cbp_luma[pos]; |
| 406 | 406 | uvcbp[i][0] = r->cbp_chroma[pos] & 0xF; |
| 407 | 407 | uvcbp[i][1] = r->cbp_chroma[pos] >> 4; |
| @@ -460,7 +460,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 52 unmodified lines | ||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | for(j = 0; j < 16; j += 4){ |
| 463 | − Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; | |
| 463 | + Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize; | |
| 464 | 464 | for(i = 0; i < 4; i++, Y += 4){ |
| 465 | 465 | int ij = i + j; |
| 466 | 466 | int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0; |
| @@ -505,7 +505,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 38 unmodified lines | ||
| 505 | 505 | } |
| 506 | 506 | for(k = 0; k < 2; k++){ |
| 507 | 507 | for(j = 0; j < 2; j++){ |
| 508 | − C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize; | |
| 508 | + C = s->cur_pic_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize; | |
| 509 | 509 | for(i = 0; i < 2; i++, C += 4){ |
| 510 | 510 | int ij = i + j*2; |
| 511 | 511 | int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0; |
| @@ -1834,9 +1834,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1833 unmodified lines | ||
| 1834 | 1834 | if (ret < 0) |
| 1835 | 1835 | return ret; |
| 1836 | 1836 | |
| 1837 | − mpv->current_picture_ptr = &mpv->current_picture; | |
| 1838 | − mpv->current_picture.f = s->current_picture; | |
| 1839 | − mpv->current_picture.f->pts = pict->pts; | |
| 1837 | + mpv->cur_pic_ptr = &mpv->cur_pic; | |
| 1838 | + mpv->cur_pic.f = s->current_picture; | |
| 1839 | + mpv->cur_pic.f->pts = pict->pts; | |
| 1840 | 1840 | if(pic->pict_type == AV_PICTURE_TYPE_P){ |
| 1841 | 1841 | int block_width = (width +15)>>4; |
| 1842 | 1842 | int block_height= (height+15)>>4; |
| @@ -1846,9 +1846,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 3 unmodified lines | ||
| 1846 | 1846 | av_assert0(s->last_picture[0]->data[0]); |
| 1847 | 1847 | |
| 1848 | 1848 | mpv->avctx = s->avctx; |
| 1849 | − mpv->last_picture.f = s->last_picture[0]; | |
| 1850 | − mpv-> new_picture = s->input_picture; | |
| 1851 | − mpv->last_picture_ptr = &mpv->last_picture; | |
| 1849 | + mpv->last_pic.f = s->last_picture[0]; | |
| 1850 | + mpv-> new_pic = s->input_picture; | |
| 1851 | + mpv->last_pic_ptr = &mpv->last_pic; | |
| 1852 | 1852 | mpv->linesize = stride; |
| 1853 | 1853 | mpv->uvlinesize = s->current_picture->linesize[1]; |
| 1854 | 1854 | mpv->width = width; |
| @@ -2043,9 +2043,9 @@ redo_frame: · 188 unmodified lines | ||
| 2043 | 2043 | mpv->frame_bits = 8 * (s->c.bytestream - s->c.bytestream_start); |
| 2044 | 2044 | mpv->p_tex_bits = mpv->frame_bits - mpv->misc_bits - mpv->mv_bits; |
| 2045 | 2045 | mpv->total_bits += 8*(s->c.bytestream - s->c.bytestream_start); |
| 2046 | − mpv->current_picture.display_picture_number = | |
| 2047 | − mpv->current_picture.coded_picture_number = avctx->frame_num; | |
| 2048 | − mpv->current_picture.f->quality = pic->quality; | |
| 2046 | + mpv->cur_pic.display_picture_number = | |
| 2047 | + mpv->cur_pic.coded_picture_number = avctx->frame_num; | |
| 2048 | + mpv->cur_pic.f->quality = pic->quality; | |
| 2049 | 2049 | if (enc->pass1_rc) |
| 2050 | 2050 | if (ff_rate_estimate_qscale(mpv, 0) < 0) |
| 2051 | 2051 | return -1; |
| @@ -326,13 +326,13 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane, · 325 unmodified lines | ||
| 326 | 326 | |
| 327 | 327 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 328 | 328 | s->m.avctx = s->avctx; |
| 329 | − s->m.current_picture_ptr = &s->m.current_picture; | |
| 330 | − s->m.last_picture_ptr = &s->m.last_picture; | |
| 331 | − s->m.last_picture.f->data[0] = ref_plane; | |
| 329 | + s->m.cur_pic_ptr = &s->m.cur_pic; | |
| 330 | + s->m.last_pic_ptr = &s->m.last_pic; | |
| 331 | + s->m.last_pic.f->data[0] = ref_plane; | |
| 332 | 332 | s->m.linesize = |
| 333 | − s->m.last_picture.f->linesize[0] = | |
| 334 | − s->m.new_picture->linesize[0] = | |
| 335 | − s->m.current_picture.f->linesize[0] = stride; | |
| 333 | + s->m.last_pic.f->linesize[0] = | |
| 334 | + s->m.new_pic->linesize[0] = | |
| 335 | + s->m.cur_pic.f->linesize[0] = stride; | |
| 336 | 336 | s->m.width = width; |
| 337 | 337 | s->m.height = height; |
| 338 | 338 | s->m.mb_width = block_width; |
| @@ -370,9 +370,9 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane, · 31 unmodified lines | ||
| 370 | 370 | s->m.mb_mean = (uint8_t *)s->dummy; |
| 371 | 371 | s->m.mb_var = (uint16_t *)s->dummy; |
| 372 | 372 | s->m.mc_mb_var = (uint16_t *)s->dummy; |
| 373 | − s->m.current_picture.mb_type = s->dummy; | |
| 373 | + s->m.cur_pic.mb_type = s->dummy; | |
| 374 | 374 | |
| 375 | − s->m.current_picture.motion_val[0] = s->motion_val8[plane] + 2; | |
| 375 | + s->m.cur_pic.motion_val[0] = s->motion_val8[plane] + 2; | |
| 376 | 376 | s->m.p_mv_table = s->motion_val16[plane] + |
| 377 | 377 | s->m.mb_stride + 1; |
| 378 | 378 | s->m.mecc = s->mecc; // move |
| @@ -381,7 +381,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane, · 2 unmodified lines | ||
| 381 | 381 | s->m.me.dia_size = s->avctx->dia_size; |
| 382 | 382 | s->m.first_slice_line = 1; |
| 383 | 383 | for (y = 0; y < block_height; y++) { |
| 384 | − s->m.new_picture->data[0] = src - y * 16 * stride; // ugly | |
| 384 | + s->m.new_pic->data[0] = src - y * 16 * stride; // ugly | |
| 385 | 385 | s->m.mb_y = y; |
| 386 | 386 | |
| 387 | 387 | for (i = 0; i < 16 && i + 16 * y < height; i++) { |
| @@ -561,7 +561,7 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx) · 173 unmodified lines | ||
| 561 | 561 | |
| 562 | 562 | av_frame_free(&s->current_picture); |
| 563 | 563 | av_frame_free(&s->last_picture); |
| 564 | − av_frame_free(&s->m.new_picture); | |
| 564 | + av_frame_free(&s->m.new_pic); | |
| 565 | 565 | |
| 566 | 566 | return 0; |
| 567 | 567 | } |
| @@ -624,10 +624,10 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) · 56 unmodified lines | ||
| 624 | 624 | s->dummy = av_mallocz((s->y_block_width + 1) * |
| 625 | 625 | s->y_block_height * sizeof(int32_t)); |
| 626 | 626 | s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map)); |
| 627 | − s->m.new_picture = av_frame_alloc(); | |
| 627 | + s->m.new_pic = av_frame_alloc(); | |
| 628 | 628 | |
| 629 | 629 | if (!s->m.me.scratchpad || !s->m.me.map || |
| 630 | − !s->mb_type || !s->dummy || !s->m.new_picture) | |
| 630 | + !s->mb_type || !s->dummy || !s->m.new_pic) | |
| 631 | 631 | return AVERROR(ENOMEM); |
| 632 | 632 | s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; |
| 633 | 633 | |
| @@ -42,12 +42,12 @@ static inline int mpeg2_get_is_frame_start(const MpegEncContext *s) · 41 unmodified lines | ||
| 42 | 42 | static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) |
| 43 | 43 | { |
| 44 | 44 | const MpegEncContext *s = avctx->priv_data; |
| 45 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 45 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 46 | 46 | VAPictureParameterBufferMPEG2 pic_param; |
| 47 | 47 | VAIQMatrixBufferMPEG2 iq_matrix; |
| 48 | 48 | int i, err; |
| 49 | 49 | |
| 50 | − pic->output_surface = ff_vaapi_get_surface_id(s->current_picture_ptr->f); | |
| 50 | + pic->output_surface = ff_vaapi_get_surface_id(s->cur_pic_ptr->f); | |
| 51 | 51 | |
| 52 | 52 | pic_param = (VAPictureParameterBufferMPEG2) { |
| 53 | 53 | .horizontal_size = s->width, |
| @@ -73,10 +73,10 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 19 unmodified lines | ||
| 73 | 73 | |
| 74 | 74 | switch (s->pict_type) { |
| 75 | 75 | case AV_PICTURE_TYPE_B: |
| 76 | − pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f); | |
| 76 | + pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_pic.f); | |
| 77 | 77 | // fall-through |
| 78 | 78 | case AV_PICTURE_TYPE_P: |
| 79 | − pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f); | |
| 79 | + pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_pic.f); | |
| 80 | 80 | break; |
| 81 | 81 | } |
| 82 | 82 | |
| @@ -115,7 +115,7 @@ fail: · 32 unmodified lines | ||
| 115 | 115 | static int vaapi_mpeg2_end_frame(AVCodecContext *avctx) |
| 116 | 116 | { |
| 117 | 117 | MpegEncContext *s = avctx->priv_data; |
| 118 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 118 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 119 | 119 | int ret; |
| 120 | 120 | |
| 121 | 121 | ret = ff_vaapi_decode_issue(avctx, pic); |
| @@ -131,7 +131,7 @@ fail: · 9 unmodified lines | ||
| 131 | 131 | static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) |
| 132 | 132 | { |
| 133 | 133 | const MpegEncContext *s = avctx->priv_data; |
| 134 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 134 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 135 | 135 | VASliceParameterBufferMPEG2 slice_param; |
| 136 | 136 | GetBitContext gb; |
| 137 | 137 | uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset; |
| @@ -49,11 +49,11 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 48 unmodified lines | ||
| 49 | 49 | { |
| 50 | 50 | Mpeg4DecContext *ctx = avctx->priv_data; |
| 51 | 51 | MpegEncContext *s = &ctx->m; |
| 52 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 52 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 53 | 53 | VAPictureParameterBufferMPEG4 pic_param; |
| 54 | 54 | int i, err; |
| 55 | 55 | |
| 56 | − pic->output_surface = ff_vaapi_get_surface_id(s->current_picture_ptr->f); | |
| 56 | + pic->output_surface = ff_vaapi_get_surface_id(s->cur_pic_ptr->f); | |
| 57 | 57 | |
| 58 | 58 | pic_param = (VAPictureParameterBufferMPEG4) { |
| 59 | 59 | .vop_width = s->width, |
| @@ -78,7 +78,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 18 unmodified lines | ||
| 78 | 78 | .vop_fields.bits = { |
| 79 | 79 | .vop_coding_type = s->pict_type - AV_PICTURE_TYPE_I, |
| 80 | 80 | .backward_reference_vop_coding_type = |
| 81 | − s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.f->pict_type - AV_PICTURE_TYPE_I : 0, | |
| 81 | + s->pict_type == AV_PICTURE_TYPE_B ? s->next_pic.f->pict_type - AV_PICTURE_TYPE_I : 0, | |
| 82 | 82 | .vop_rounding_type = s->no_rounding, |
| 83 | 83 | .intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(ctx), |
| 84 | 84 | .top_field_first = s->top_field_first, |
| @@ -100,9 +100,9 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 15 unmodified lines | ||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | if (s->pict_type == AV_PICTURE_TYPE_B) |
| 103 | − pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f); | |
| 103 | + pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_pic.f); | |
| 104 | 104 | if (s->pict_type != AV_PICTURE_TYPE_I) |
| 105 | − pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f); | |
| 105 | + pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_pic.f); | |
| 106 | 106 | |
| 107 | 107 | err = ff_vaapi_decode_make_param_buffer(avctx, pic, |
| 108 | 108 | VAPictureParameterBufferType, |
| @@ -139,7 +139,7 @@ fail: · 30 unmodified lines | ||
| 139 | 139 | static int vaapi_mpeg4_end_frame(AVCodecContext *avctx) |
| 140 | 140 | { |
| 141 | 141 | MpegEncContext *s = avctx->priv_data; |
| 142 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 142 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 143 | 143 | int ret; |
| 144 | 144 | |
| 145 | 145 | ret = ff_vaapi_decode_issue(avctx, pic); |
| @@ -155,7 +155,7 @@ fail: · 9 unmodified lines | ||
| 155 | 155 | static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) |
| 156 | 156 | { |
| 157 | 157 | MpegEncContext *s = avctx->priv_data; |
| 158 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 158 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 159 | 159 | VASliceParameterBufferMPEG4 slice_param; |
| 160 | 160 | int err; |
| 161 | 161 | |
| @@ -253,11 +253,11 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t · 252 unmodified lines | ||
| 253 | 253 | { |
| 254 | 254 | const VC1Context *v = avctx->priv_data; |
| 255 | 255 | const MpegEncContext *s = &v->s; |
| 256 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 256 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 257 | 257 | VAPictureParameterBufferVC1 pic_param; |
| 258 | 258 | int err; |
| 259 | 259 | |
| 260 | − pic->output_surface = ff_vaapi_get_surface_id(s->current_picture_ptr->f); | |
| 260 | + pic->output_surface = ff_vaapi_get_surface_id(s->cur_pic_ptr->f); | |
| 261 | 261 | |
| 262 | 262 | pic_param = (VAPictureParameterBufferVC1) { |
| 263 | 263 | .forward_reference_picture = VA_INVALID_ID, |
| @@ -374,10 +374,10 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t · 110 unmodified lines | ||
| 374 | 374 | |
| 375 | 375 | switch (s->pict_type) { |
| 376 | 376 | case AV_PICTURE_TYPE_B: |
| 377 | − pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f); | |
| 377 | + pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_pic.f); | |
| 378 | 378 | // fall-through |
| 379 | 379 | case AV_PICTURE_TYPE_P: |
| 380 | − pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f); | |
| 380 | + pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_pic.f); | |
| 381 | 381 | break; |
| 382 | 382 | } |
| 383 | 383 | |
| @@ -450,7 +450,7 @@ static int vaapi_vc1_end_frame(AVCodecContext *avctx) · 66 unmodified lines | ||
| 450 | 450 | { |
| 451 | 451 | VC1Context *v = avctx->priv_data; |
| 452 | 452 | MpegEncContext *s = &v->s; |
| 453 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 453 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 454 | 454 | int ret; |
| 455 | 455 | |
| 456 | 456 | ret = ff_vaapi_decode_issue(avctx, pic); |
| @@ -465,7 +465,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, · 8 unmodified lines | ||
| 465 | 465 | { |
| 466 | 466 | const VC1Context *v = avctx->priv_data; |
| 467 | 467 | const MpegEncContext *s = &v->s; |
| 468 | − VAAPIDecodePicture *pic = s->current_picture_ptr->hwaccel_picture_private; | |
| 468 | + VAAPIDecodePicture *pic = s->cur_pic_ptr->hwaccel_picture_private; | |
| 469 | 469 | VASliceParameterBufferVC1 slice_param; |
| 470 | 470 | int mb_height; |
| 471 | 471 | int err; |
| @@ -856,7 +856,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 855 unmodified lines | ||
| 856 | 856 | v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B; |
| 857 | 857 | else |
| 858 | 858 | v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; |
| 859 | − v->s.current_picture_ptr->f->pict_type = v->s.pict_type; | |
| 859 | + v->s.cur_pic_ptr->f->pict_type = v->s.pict_type; | |
| 860 | 860 | if (!v->pic_header_flag) |
| 861 | 861 | goto parse_common_info; |
| 862 | 862 | } |
| @@ -59,9 +59,9 @@ static inline void init_block_index(VC1Context *v) · 58 unmodified lines | ||
| 59 | 59 | MpegEncContext *s = &v->s; |
| 60 | 60 | ff_init_block_index(s); |
| 61 | 61 | if (v->field_mode && !(v->second_field ^ v->tff)) { |
| 62 | − s->dest[0] += s->current_picture_ptr->f->linesize[0]; | |
| 63 | − s->dest[1] += s->current_picture_ptr->f->linesize[1]; | |
| 64 | − s->dest[2] += s->current_picture_ptr->f->linesize[2]; | |
| 62 | + s->dest[0] += s->cur_pic_ptr->f->linesize[0]; | |
| 63 | + s->dest[1] += s->cur_pic_ptr->f->linesize[1]; | |
| 64 | + s->dest[2] += s->cur_pic_ptr->f->linesize[2]; | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| @@ -417,7 +417,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 349 unmodified lines | ||
| 417 | 417 | int dqscale_index; |
| 418 | 418 | |
| 419 | 419 | /* scale predictors if needed */ |
| 420 | − q1 = FFABS(s->current_picture.qscale_table[mb_pos]); | |
| 420 | + q1 = FFABS(s->cur_pic.qscale_table[mb_pos]); | |
| 421 | 421 | dqscale_index = s->y_dc_scale_table[q1] - 1; |
| 422 | 422 | if (dqscale_index < 0) |
| 423 | 423 | return 0; |
| @@ -433,12 +433,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 9 unmodified lines | ||
| 433 | 433 | a = dc_val[ - wrap]; |
| 434 | 434 | |
| 435 | 435 | if (c_avail && (n != 1 && n != 3)) { |
| 436 | − q2 = FFABS(s->current_picture.qscale_table[mb_pos - 1]); | |
| 436 | + q2 = FFABS(s->cur_pic.qscale_table[mb_pos - 1]); | |
| 437 | 437 | if (q2 && q2 != q1) |
| 438 | 438 | c = (int)((unsigned)c * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; |
| 439 | 439 | } |
| 440 | 440 | if (a_avail && (n != 2 && n != 3)) { |
| 441 | − q2 = FFABS(s->current_picture.qscale_table[mb_pos - s->mb_stride]); | |
| 441 | + q2 = FFABS(s->cur_pic.qscale_table[mb_pos - s->mb_stride]); | |
| 442 | 442 | if (q2 && q2 != q1) |
| 443 | 443 | a = (int)((unsigned)a * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; |
| 444 | 444 | } |
| @@ -448,7 +448,7 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, · 3 unmodified lines | ||
| 448 | 448 | off--; |
| 449 | 449 | if (n != 2) |
| 450 | 450 | off -= s->mb_stride; |
| 451 | − q2 = FFABS(s->current_picture.qscale_table[off]); | |
| 451 | + q2 = FFABS(s->cur_pic.qscale_table[off]); | |
| 452 | 452 | if (q2 && q2 != q1) |
| 453 | 453 | b = (int)((unsigned)b * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18; |
| 454 | 454 | } |
| @@ -771,19 +771,19 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, · 316 unmodified lines | ||
| 771 | 771 | else // top |
| 772 | 772 | ac_val -= 16 * s->block_wrap[n]; |
| 773 | 773 | |
| 774 | − q1 = s->current_picture.qscale_table[mb_pos]; | |
| 774 | + q1 = s->cur_pic.qscale_table[mb_pos]; | |
| 775 | 775 | if (n == 3) |
| 776 | 776 | q2 = q1; |
| 777 | 777 | else if (dc_pred_dir) { |
| 778 | 778 | if (n == 1) |
| 779 | 779 | q2 = q1; |
| 780 | 780 | else if (c_avail && mb_pos) |
| 781 | − q2 = s->current_picture.qscale_table[mb_pos - 1]; | |
| 781 | + q2 = s->cur_pic.qscale_table[mb_pos - 1]; | |
| 782 | 782 | } else { |
| 783 | 783 | if (n == 2) |
| 784 | 784 | q2 = q1; |
| 785 | 785 | else if (a_avail && mb_pos >= s->mb_stride) |
| 786 | − q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; | |
| 786 | + q2 = s->cur_pic.qscale_table[mb_pos - s->mb_stride]; | |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | //AC Decoding |
| @@ -973,11 +973,11 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, · 183 unmodified lines | ||
| 973 | 973 | else //top |
| 974 | 974 | ac_val -= 16 * s->block_wrap[n]; |
| 975 | 975 | |
| 976 | − q1 = s->current_picture.qscale_table[mb_pos]; | |
| 976 | + q1 = s->cur_pic.qscale_table[mb_pos]; | |
| 977 | 977 | if (dc_pred_dir && c_avail && mb_pos) |
| 978 | − q2 = s->current_picture.qscale_table[mb_pos - 1]; | |
| 978 | + q2 = s->cur_pic.qscale_table[mb_pos - 1]; | |
| 979 | 979 | if (!dc_pred_dir && a_avail && mb_pos >= s->mb_stride) |
| 980 | − q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride]; | |
| 980 | + q2 = s->cur_pic.qscale_table[mb_pos - s->mb_stride]; | |
| 981 | 981 | if (dc_pred_dir && n == 1) |
| 982 | 982 | q2 = q1; |
| 983 | 983 | if (!dc_pred_dir && n == 2) |
| @@ -1314,10 +1314,10 @@ static int vc1_decode_p_mb(VC1Context *v) · 330 unmodified lines | ||
| 1314 | 1314 | GET_MVDATA(dmv_x, dmv_y); |
| 1315 | 1315 | |
| 1316 | 1316 | if (s->mb_intra) { |
| 1317 | − s->current_picture.motion_val[1][s->block_index[0]][0] = 0; | |
| 1318 | − s->current_picture.motion_val[1][s->block_index[0]][1] = 0; | |
| 1317 | + s->cur_pic.motion_val[1][s->block_index[0]][0] = 0; | |
| 1318 | + s->cur_pic.motion_val[1][s->block_index[0]][1] = 0; | |
| 1319 | 1319 | } |
| 1320 | − s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; | |
| 1320 | + s->cur_pic.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; | |
| 1321 | 1321 | ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0); |
| 1322 | 1322 | |
| 1323 | 1323 | /* FIXME Set DC val for inter block ? */ |
| @@ -1334,7 +1334,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 10 unmodified lines | ||
| 1334 | 1334 | mquant = v->pq; |
| 1335 | 1335 | cbp = 0; |
| 1336 | 1336 | } |
| 1337 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1337 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1338 | 1338 | |
| 1339 | 1339 | if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) |
| 1340 | 1340 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], |
| @@ -1383,8 +1383,8 @@ static int vc1_decode_p_mb(VC1Context *v) · 42 unmodified lines | ||
| 1383 | 1383 | v->mb_type[0][s->block_index[i]] = 0; |
| 1384 | 1384 | s->dc_val[0][s->block_index[i]] = 0; |
| 1385 | 1385 | } |
| 1386 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 1387 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 1386 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 1387 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 1388 | 1388 | ff_vc1_pred_mv(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0); |
| 1389 | 1389 | ff_vc1_mc_1mv(v, 0); |
| 1390 | 1390 | } |
| @@ -1427,7 +1427,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 36 unmodified lines | ||
| 1427 | 1427 | if (!intra_count && !coded_inter) |
| 1428 | 1428 | goto end; |
| 1429 | 1429 | GET_MQUANT(); |
| 1430 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1430 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1431 | 1431 | /* test if block is intra and has pred */ |
| 1432 | 1432 | { |
| 1433 | 1433 | int intrapred = 0; |
| @@ -1484,7 +1484,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 50 unmodified lines | ||
| 1484 | 1484 | } |
| 1485 | 1485 | } else { // skipped MB |
| 1486 | 1486 | s->mb_intra = 0; |
| 1487 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 1487 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 1488 | 1488 | for (i = 0; i < 6; i++) { |
| 1489 | 1489 | v->mb_type[0][s->block_index[i]] = 0; |
| 1490 | 1490 | s->dc_val[0][s->block_index[i]] = 0; |
| @@ -1494,7 +1494,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 3 unmodified lines | ||
| 1494 | 1494 | ff_vc1_mc_4mv_luma(v, i, 0, 0); |
| 1495 | 1495 | } |
| 1496 | 1496 | ff_vc1_mc_4mv_chroma(v, 0); |
| 1497 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 1497 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 1498 | 1498 | } |
| 1499 | 1499 | } |
| 1500 | 1500 | end: |
| @@ -1574,19 +1574,19 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 73 unmodified lines | ||
| 1574 | 1574 | } |
| 1575 | 1575 | if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB |
| 1576 | 1576 | for (i = 0; i < 4; i++) { |
| 1577 | − s->current_picture.motion_val[1][s->block_index[i]][0] = 0; | |
| 1578 | − s->current_picture.motion_val[1][s->block_index[i]][1] = 0; | |
| 1577 | + s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; | |
| 1578 | + s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; | |
| 1579 | 1579 | } |
| 1580 | 1580 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 1581 | 1581 | s->mb_intra = 1; |
| 1582 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 1582 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 1583 | 1583 | fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); |
| 1584 | 1584 | mb_has_coeffs = get_bits1(gb); |
| 1585 | 1585 | if (mb_has_coeffs) |
| 1586 | 1586 | cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); |
| 1587 | 1587 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 1588 | 1588 | GET_MQUANT(); |
| 1589 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1589 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1590 | 1590 | /* Set DC scale - y and c use the same (not sure if necessary here) */ |
| 1591 | 1591 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 1592 | 1592 | s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; |
| @@ -1666,7 +1666,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 73 unmodified lines | ||
| 1666 | 1666 | } |
| 1667 | 1667 | if (cbp) |
| 1668 | 1668 | GET_MQUANT(); // p. 227 |
| 1669 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1669 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1670 | 1670 | if (!v->ttmbf && cbp) |
| 1671 | 1671 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 1672 | 1672 | for (i = 0; i < 6; i++) { |
| @@ -1697,8 +1697,8 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 24 unmodified lines | ||
| 1697 | 1697 | v->mb_type[0][s->block_index[i]] = 0; |
| 1698 | 1698 | s->dc_val[0][s->block_index[i]] = 0; |
| 1699 | 1699 | } |
| 1700 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 1701 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 1700 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 1701 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 1702 | 1702 | v->blk_mv_type[s->block_index[0]] = 0; |
| 1703 | 1703 | v->blk_mv_type[s->block_index[1]] = 0; |
| 1704 | 1704 | v->blk_mv_type[s->block_index[2]] = 0; |
| @@ -1742,11 +1742,11 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 37 unmodified lines | ||
| 1742 | 1742 | if (idx_mbmode <= 1) { // intra MB |
| 1743 | 1743 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 1744 | 1744 | s->mb_intra = 1; |
| 1745 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; | |
| 1746 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; | |
| 1747 | − s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 1745 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; | |
| 1746 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; | |
| 1747 | + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 1748 | 1748 | GET_MQUANT(); |
| 1749 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1749 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1750 | 1750 | /* Set DC scale - y and c use the same (not sure if necessary here) */ |
| 1751 | 1751 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 1752 | 1752 | s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; |
| @@ -1775,7 +1775,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 22 unmodified lines | ||
| 1775 | 1775 | } |
| 1776 | 1776 | } else { |
| 1777 | 1777 | s->mb_intra = v->is_intra[s->mb_x] = 0; |
| 1778 | − s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; | |
| 1778 | + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; | |
| 1779 | 1779 | for (i = 0; i < 6; i++) |
| 1780 | 1780 | v->mb_type[0][s->block_index[i]] = 0; |
| 1781 | 1781 | if (idx_mbmode <= 5) { // 1-MV |
| @@ -1803,7 +1803,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 21 unmodified lines | ||
| 1803 | 1803 | if (cbp) { |
| 1804 | 1804 | GET_MQUANT(); |
| 1805 | 1805 | } |
| 1806 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1806 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1807 | 1807 | if (!v->ttmbf && cbp) { |
| 1808 | 1808 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 1809 | 1809 | } |
| @@ -1875,7 +1875,7 @@ static int vc1_decode_b_mb(VC1Context *v) · 65 unmodified lines | ||
| 1875 | 1875 | v->mb_type[0][s->block_index[i]] = 0; |
| 1876 | 1876 | s->dc_val[0][s->block_index[i]] = 0; |
| 1877 | 1877 | } |
| 1878 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 1878 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 1879 | 1879 | |
| 1880 | 1880 | if (!direct) { |
| 1881 | 1881 | if (!skipped) { |
| @@ -1912,7 +1912,7 @@ static int vc1_decode_b_mb(VC1Context *v) · 30 unmodified lines | ||
| 1912 | 1912 | cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); |
| 1913 | 1913 | GET_MQUANT(); |
| 1914 | 1914 | s->mb_intra = 0; |
| 1915 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1915 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1916 | 1916 | if (!v->ttmbf) |
| 1917 | 1917 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 1918 | 1918 | dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0; |
| @@ -1927,7 +1927,7 @@ static int vc1_decode_b_mb(VC1Context *v) · 8 unmodified lines | ||
| 1927 | 1927 | } |
| 1928 | 1928 | if (s->mb_intra && !mb_has_coeffs) { |
| 1929 | 1929 | GET_MQUANT(); |
| 1930 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1930 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1931 | 1931 | s->ac_pred = get_bits1(gb); |
| 1932 | 1932 | cbp = 0; |
| 1933 | 1933 | ff_vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype); |
| @@ -1949,7 +1949,7 @@ static int vc1_decode_b_mb(VC1Context *v) · 15 unmodified lines | ||
| 1949 | 1949 | s->ac_pred = get_bits1(gb); |
| 1950 | 1950 | cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); |
| 1951 | 1951 | GET_MQUANT(); |
| 1952 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 1952 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 1953 | 1953 | if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) |
| 1954 | 1954 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 1955 | 1955 | } |
| @@ -2024,11 +2024,11 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 68 unmodified lines | ||
| 2024 | 2024 | if (idx_mbmode <= 1) { // intra MB |
| 2025 | 2025 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 2026 | 2026 | s->mb_intra = 1; |
| 2027 | − s->current_picture.motion_val[1][s->block_index[0]][0] = 0; | |
| 2028 | − s->current_picture.motion_val[1][s->block_index[0]][1] = 0; | |
| 2029 | − s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 2027 | + s->cur_pic.motion_val[1][s->block_index[0]][0] = 0; | |
| 2028 | + s->cur_pic.motion_val[1][s->block_index[0]][1] = 0; | |
| 2029 | + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 2030 | 2030 | GET_MQUANT(); |
| 2031 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 2031 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 2032 | 2032 | /* Set DC scale - y and c use the same (not sure if necessary here) */ |
| 2033 | 2033 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2034 | 2034 | s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; |
| @@ -2064,7 +2064,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 29 unmodified lines | ||
| 2064 | 2064 | } |
| 2065 | 2065 | } else { |
| 2066 | 2066 | s->mb_intra = v->is_intra[s->mb_x] = 0; |
| 2067 | − s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; | |
| 2067 | + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16; | |
| 2068 | 2068 | for (i = 0; i < 6; i++) |
| 2069 | 2069 | v->mb_type[0][s->block_index[i]] = 0; |
| 2070 | 2070 | if (v->fmb_is_raw) |
| @@ -2101,7 +2101,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 30 unmodified lines | ||
| 2101 | 2101 | if (bmvtype == BMV_TYPE_DIRECT) { |
| 2102 | 2102 | dmv_x[0] = dmv_y[0] = pred_flag[0] = 0; |
| 2103 | 2103 | dmv_x[1] = dmv_y[1] = pred_flag[0] = 0; |
| 2104 | − if (!s->next_picture_ptr->field_picture) { | |
| 2104 | + if (!s->next_pic_ptr->field_picture) { | |
| 2105 | 2105 | av_log(s->avctx, AV_LOG_ERROR, "Mixed field/frame direct mode not supported\n"); |
| 2106 | 2106 | return AVERROR_INVALIDDATA; |
| 2107 | 2107 | } |
| @@ -2133,7 +2133,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 25 unmodified lines | ||
| 2133 | 2133 | if (cbp) { |
| 2134 | 2134 | GET_MQUANT(); |
| 2135 | 2135 | } |
| 2136 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 2136 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 2137 | 2137 | if (!v->ttmbf && cbp) { |
| 2138 | 2138 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 2139 | 2139 | } |
| @@ -2212,21 +2212,21 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 72 unmodified lines | ||
| 2212 | 2212 | |
| 2213 | 2213 | if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_INTRA) { // intra MB |
| 2214 | 2214 | for (i = 0; i < 4; i++) { |
| 2215 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = 0; | |
| 2216 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = 0; | |
| 2217 | − s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = 0; | |
| 2218 | − s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = 0; | |
| 2215 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = 0; | |
| 2216 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = 0; | |
| 2217 | + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; | |
| 2218 | + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; | |
| 2219 | 2219 | } |
| 2220 | 2220 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 2221 | 2221 | s->mb_intra = 1; |
| 2222 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 2222 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 2223 | 2223 | fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); |
| 2224 | 2224 | mb_has_coeffs = get_bits1(gb); |
| 2225 | 2225 | if (mb_has_coeffs) |
| 2226 | 2226 | cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); |
| 2227 | 2227 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 2228 | 2228 | GET_MQUANT(); |
| 2229 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 2229 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 2230 | 2230 | /* Set DC scale - y and c use the same (not sure if necessary here) */ |
| 2231 | 2231 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2232 | 2232 | s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; |
| @@ -2267,31 +2267,31 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 34 unmodified lines | ||
| 2267 | 2267 | direct = v->direct_mb_plane[mb_pos]; |
| 2268 | 2268 | |
| 2269 | 2269 | if (direct) { |
| 2270 | − if (s->next_picture_ptr->field_picture) | |
| 2270 | + if (s->next_pic_ptr->field_picture) | |
| 2271 | 2271 | av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n"); |
| 2272 | − s->mv[0][0][0] = s->current_picture.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample); | |
| 2273 | − s->mv[0][0][1] = s->current_picture.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample); | |
| 2274 | − s->mv[1][0][0] = s->current_picture.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample); | |
| 2275 | − s->mv[1][0][1] = s->current_picture.motion_val[1][s->block_index[0]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0]][1], v->bfraction, 1, s->quarter_sample); | |
| 2272 | + s->mv[0][0][0] = s->cur_pic.motion_val[0][s->block_index[0]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][0], v->bfraction, 0, s->quarter_sample); | |
| 2273 | + s->mv[0][0][1] = s->cur_pic.motion_val[0][s->block_index[0]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][1], v->bfraction, 0, s->quarter_sample); | |
| 2274 | + s->mv[1][0][0] = s->cur_pic.motion_val[1][s->block_index[0]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][0], v->bfraction, 1, s->quarter_sample); | |
| 2275 | + s->mv[1][0][1] = s->cur_pic.motion_val[1][s->block_index[0]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0]][1], v->bfraction, 1, s->quarter_sample); | |
| 2276 | 2276 | |
| 2277 | 2277 | if (twomv) { |
| 2278 | − s->mv[0][2][0] = s->current_picture.motion_val[0][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 0, s->quarter_sample); | |
| 2279 | − s->mv[0][2][1] = s->current_picture.motion_val[0][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 0, s->quarter_sample); | |
| 2280 | − s->mv[1][2][0] = s->current_picture.motion_val[1][s->block_index[2]][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][0], v->bfraction, 1, s->quarter_sample); | |
| 2281 | − s->mv[1][2][1] = s->current_picture.motion_val[1][s->block_index[2]][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[2]][1], v->bfraction, 1, s->quarter_sample); | |
| 2278 | + s->mv[0][2][0] = s->cur_pic.motion_val[0][s->block_index[2]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][0], v->bfraction, 0, s->quarter_sample); | |
| 2279 | + s->mv[0][2][1] = s->cur_pic.motion_val[0][s->block_index[2]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][1], v->bfraction, 0, s->quarter_sample); | |
| 2280 | + s->mv[1][2][0] = s->cur_pic.motion_val[1][s->block_index[2]][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][0], v->bfraction, 1, s->quarter_sample); | |
| 2281 | + s->mv[1][2][1] = s->cur_pic.motion_val[1][s->block_index[2]][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[2]][1], v->bfraction, 1, s->quarter_sample); | |
| 2282 | 2282 | |
| 2283 | 2283 | for (i = 1; i < 4; i += 2) { |
| 2284 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][i-1][0]; | |
| 2285 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][i-1][1]; | |
| 2286 | − s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][i-1][0]; | |
| 2287 | − s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][i-1][1]; | |
| 2284 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = s->mv[0][i-1][0]; | |
| 2285 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = s->mv[0][i-1][1]; | |
| 2286 | + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = s->mv[1][i-1][0]; | |
| 2287 | + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = s->mv[1][i-1][1]; | |
| 2288 | 2288 | } |
| 2289 | 2289 | } else { |
| 2290 | 2290 | for (i = 1; i < 4; i++) { |
| 2291 | − s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0] = s->mv[0][0][0]; | |
| 2292 | − s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1] = s->mv[0][0][1]; | |
| 2293 | − s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = s->mv[1][0][0]; | |
| 2294 | − s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = s->mv[1][0][1]; | |
| 2291 | + s->mv[0][i][0] = s->cur_pic.motion_val[0][s->block_index[i]][0] = s->mv[0][0][0]; | |
| 2292 | + s->mv[0][i][1] = s->cur_pic.motion_val[0][s->block_index[i]][1] = s->mv[0][0][1]; | |
| 2293 | + s->mv[1][i][0] = s->cur_pic.motion_val[1][s->block_index[i]][0] = s->mv[1][0][0]; | |
| 2294 | + s->mv[1][i][1] = s->cur_pic.motion_val[1][s->block_index[i]][1] = s->mv[1][0][1]; | |
| 2295 | 2295 | } |
| 2296 | 2296 | } |
| 2297 | 2297 | } |
| @@ -2393,10 +2393,10 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 95 unmodified lines | ||
| 2393 | 2393 | |
| 2394 | 2394 | if (mvsw) { |
| 2395 | 2395 | for (i = 0; i < 2; i++) { |
| 2396 | − s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0]; | |
| 2397 | − s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1]; | |
| 2398 | − s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0]; | |
| 2399 | − s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1]; | |
| 2396 | + s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->cur_pic.motion_val[dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[dir][s->block_index[i]][0]; | |
| 2397 | + s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->cur_pic.motion_val[dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[dir][s->block_index[i]][1]; | |
| 2398 | + s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->cur_pic.motion_val[dir2][s->block_index[i]][0] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][0]; | |
| 2399 | + s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->cur_pic.motion_val[dir2][s->block_index[i]][1] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][1]; | |
| 2400 | 2400 | } |
| 2401 | 2401 | } else { |
| 2402 | 2402 | ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); |
| @@ -2423,15 +2423,15 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 20 unmodified lines | ||
| 2423 | 2423 | v->blk_mv_type[s->block_index[3]] = 1; |
| 2424 | 2424 | ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); |
| 2425 | 2425 | for (i = 0; i < 2; i++) { |
| 2426 | − s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0]; | |
| 2427 | − s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1]; | |
| 2426 | + s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[!dir][s->block_index[i]][0]; | |
| 2427 | + s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[!dir][s->block_index[i]][1]; | |
| 2428 | 2428 | } |
| 2429 | 2429 | ff_vc1_mc_1mv(v, dir); |
| 2430 | 2430 | } |
| 2431 | 2431 | |
| 2432 | 2432 | if (cbp) |
| 2433 | 2433 | GET_MQUANT(); // p. 227 |
| 2434 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 2434 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 2435 | 2435 | if (!v->ttmbf && cbp) |
| 2436 | 2436 | ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); |
| 2437 | 2437 | for (i = 0; i < 6; i++) { |
| @@ -2462,8 +2462,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 24 unmodified lines | ||
| 2462 | 2462 | v->mb_type[0][s->block_index[i]] = 0; |
| 2463 | 2463 | s->dc_val[0][s->block_index[i]] = 0; |
| 2464 | 2464 | } |
| 2465 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 2466 | − s->current_picture.qscale_table[mb_pos] = 0; | |
| 2465 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_SKIP; | |
| 2466 | + s->cur_pic.qscale_table[mb_pos] = 0; | |
| 2467 | 2467 | v->blk_mv_type[s->block_index[0]] = 0; |
| 2468 | 2468 | v->blk_mv_type[s->block_index[1]] = 0; |
| 2469 | 2469 | v->blk_mv_type[s->block_index[2]] = 0; |
| @@ -2481,10 +2481,10 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 11 unmodified lines | ||
| 2481 | 2481 | if (mvsw) |
| 2482 | 2482 | dir2 = !dir; |
| 2483 | 2483 | for (i = 0; i < 2; i++) { |
| 2484 | − s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->current_picture.motion_val[dir][s->block_index[i+2]][0] = s->current_picture.motion_val[dir][s->block_index[i]][0]; | |
| 2485 | − s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->current_picture.motion_val[dir][s->block_index[i+2]][1] = s->current_picture.motion_val[dir][s->block_index[i]][1]; | |
| 2486 | − s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->current_picture.motion_val[dir2][s->block_index[i]][0] = s->current_picture.motion_val[dir2][s->block_index[i+2]][0]; | |
| 2487 | − s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->current_picture.motion_val[dir2][s->block_index[i]][1] = s->current_picture.motion_val[dir2][s->block_index[i+2]][1]; | |
| 2484 | + s->mv[dir][i+2][0] = s->mv[dir][i][0] = s->cur_pic.motion_val[dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[dir][s->block_index[i]][0]; | |
| 2485 | + s->mv[dir][i+2][1] = s->mv[dir][i][1] = s->cur_pic.motion_val[dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[dir][s->block_index[i]][1]; | |
| 2486 | + s->mv[dir2][i+2][0] = s->mv[dir2][i][0] = s->cur_pic.motion_val[dir2][s->block_index[i]][0] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][0]; | |
| 2487 | + s->mv[dir2][i+2][1] = s->mv[dir2][i][1] = s->cur_pic.motion_val[dir2][s->block_index[i]][1] = s->cur_pic.motion_val[dir2][s->block_index[i+2]][1]; | |
| 2488 | 2488 | } |
| 2489 | 2489 | } else { |
| 2490 | 2490 | v->blk_mv_type[s->block_index[0]] = 1; |
| @@ -2493,8 +2493,8 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 2 unmodified lines | ||
| 2493 | 2493 | v->blk_mv_type[s->block_index[3]] = 1; |
| 2494 | 2494 | ff_vc1_pred_mv_intfr(v, 0, 0, 0, 2, v->range_x, v->range_y, !dir); |
| 2495 | 2495 | for (i = 0; i < 2; i++) { |
| 2496 | − s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->current_picture.motion_val[!dir][s->block_index[i+2]][0] = s->current_picture.motion_val[!dir][s->block_index[i]][0]; | |
| 2497 | − s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->current_picture.motion_val[!dir][s->block_index[i+2]][1] = s->current_picture.motion_val[!dir][s->block_index[i]][1]; | |
| 2496 | + s->mv[!dir][i+2][0] = s->mv[!dir][i][0] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][0] = s->cur_pic.motion_val[!dir][s->block_index[i]][0]; | |
| 2497 | + s->mv[!dir][i+2][1] = s->mv[!dir][i][1] = s->cur_pic.motion_val[!dir][s->block_index[i+2]][1] = s->cur_pic.motion_val[!dir][s->block_index[i]][1]; | |
| 2498 | 2498 | } |
| 2499 | 2499 | } |
| 2500 | 2500 | } |
| @@ -2563,11 +2563,11 @@ static void vc1_decode_i_blocks(VC1Context *v) · 62 unmodified lines | ||
| 2563 | 2563 | update_block_index(s); |
| 2564 | 2564 | s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); |
| 2565 | 2565 | mb_pos = s->mb_x + s->mb_y * s->mb_width; |
| 2566 | − s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 2567 | − s->current_picture.qscale_table[mb_pos] = v->pq; | |
| 2566 | + s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; | |
| 2567 | + s->cur_pic.qscale_table[mb_pos] = v->pq; | |
| 2568 | 2568 | for (int i = 0; i < 4; i++) { |
| 2569 | − s->current_picture.motion_val[1][s->block_index[i]][0] = 0; | |
| 2570 | − s->current_picture.motion_val[1][s->block_index[i]][1] = 0; | |
| 2569 | + s->cur_pic.motion_val[1][s->block_index[i]][0] = 0; | |
| 2570 | + s->cur_pic.motion_val[1][s->block_index[i]][1] = 0; | |
| 2571 | 2571 | } |
| 2572 | 2572 | |
| 2573 | 2573 | // do actual MB decoding and displaying |
| @@ -2693,10 +2693,10 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) · 119 unmodified lines | ||
| 2693 | 2693 | update_block_index(s); |
| 2694 | 2694 | s->bdsp.clear_blocks(v->block[v->cur_blk_idx][0]); |
| 2695 | 2695 | mb_pos = s->mb_x + s->mb_y * s->mb_stride; |
| 2696 | − s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 2696 | + s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; | |
| 2697 | 2697 | for (int i = 0; i < 4; i++) { |
| 2698 | − s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = 0; | |
| 2699 | − s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = 0; | |
| 2698 | + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][0] = 0; | |
| 2699 | + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][1] = 0; | |
| 2700 | 2700 | } |
| 2701 | 2701 | |
| 2702 | 2702 | // do actual MB decoding and displaying |
| @@ -2719,7 +2719,7 @@ static int vc1_decode_i_blocks_adv(VC1Context *v) · 16 unmodified lines | ||
| 2719 | 2719 | |
| 2720 | 2720 | GET_MQUANT(); |
| 2721 | 2721 | |
| 2722 | − s->current_picture.qscale_table[mb_pos] = mquant; | |
| 2722 | + s->cur_pic.qscale_table[mb_pos] = mquant; | |
| 2723 | 2723 | /* Set DC scale - y and c use the same */ |
| 2724 | 2724 | s->y_dc_scale = s->y_dc_scale_table[FFABS(mquant)]; |
| 2725 | 2725 | s->c_dc_scale = s->c_dc_scale_table[FFABS(mquant)]; |
| @@ -2943,7 +2943,7 @@ static void vc1_decode_skip_blocks(VC1Context *v) · 217 unmodified lines | ||
| 2943 | 2943 | { |
| 2944 | 2944 | MpegEncContext *s = &v->s; |
| 2945 | 2945 | |
| 2946 | − if (!v->s.last_picture.f->data[0]) | |
| 2946 | + if (!v->s.last_pic.f->data[0]) | |
| 2947 | 2947 | return; |
| 2948 | 2948 | |
| 2949 | 2949 | ff_er_add_slice(&s->er, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END); |
| @@ -2952,9 +2952,9 @@ static void vc1_decode_skip_blocks(VC1Context *v) · 2 unmodified lines | ||
| 2952 | 2952 | s->mb_x = 0; |
| 2953 | 2953 | init_block_index(v); |
| 2954 | 2954 | update_block_index(s); |
| 2955 | − memcpy(s->dest[0], s->last_picture.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16); | |
| 2956 | − memcpy(s->dest[1], s->last_picture.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); | |
| 2957 | − memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); | |
| 2955 | + memcpy(s->dest[0], s->last_pic.f->data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16); | |
| 2956 | + memcpy(s->dest[1], s->last_pic.f->data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); | |
| 2957 | + memcpy(s->dest[2], s->last_pic.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8); | |
| 2958 | 2958 | s->first_slice_line = 0; |
| 2959 | 2959 | } |
| 2960 | 2960 | } |
| @@ -2964,7 +2964,7 @@ void ff_vc1_decode_blocks(VC1Context *v) · 3 unmodified lines | ||
| 2964 | 2964 | |
| 2965 | 2965 | v->s.esc3_level_length = 0; |
| 2966 | 2966 | if (v->x8_type) { |
| 2967 | − ff_intrax8_decode_picture(&v->x8, &v->s.current_picture, | |
| 2967 | + ff_intrax8_decode_picture(&v->x8, &v->s.cur_pic, | |
| 2968 | 2968 | &v->s.gb, &v->s.mb_x, &v->s.mb_y, |
| 2969 | 2969 | 2 * v->pq + v->halfpq, v->pq * !v->pquantizer, |
| 2970 | 2970 | v->s.loop_filter, v->s.low_delay); |
| @@ -500,7 +500,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 499 unmodified lines | ||
| 500 | 500 | cbp, |
| 501 | 501 | is_intra, |
| 502 | 502 | i > 3 ? uvmv : |
| 503 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], | |
| 503 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], | |
| 504 | 504 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 1 + v->mb_off] : |
| 505 | 505 | &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], |
| 506 | 506 | ttblk, |
| @@ -520,7 +520,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 13 unmodified lines | ||
| 520 | 520 | cbp, |
| 521 | 521 | is_intra, |
| 522 | 522 | i > 3 ? uvmv : |
| 523 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], | |
| 523 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], | |
| 524 | 524 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride + v->mb_off] : |
| 525 | 525 | &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], |
| 526 | 526 | ttblk, |
| @@ -543,7 +543,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 16 unmodified lines | ||
| 543 | 543 | cbp, |
| 544 | 544 | is_intra, |
| 545 | 545 | i > 3 ? uvmv : |
| 546 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], | |
| 546 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], | |
| 547 | 547 | i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 1 + v->mb_off] : |
| 548 | 548 | &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], |
| 549 | 549 | ttblk, |
| @@ -562,7 +562,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 12 unmodified lines | ||
| 562 | 562 | cbp, |
| 563 | 563 | is_intra, |
| 564 | 564 | i > 3 ? uvmv : |
| 565 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 + v->blocks_off], | |
| 565 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 + v->blocks_off], | |
| 566 | 566 | i > 3 ? &v->mv_f[0][s->block_index[i] - 1 + v->mb_off] : |
| 567 | 567 | &v->mv_f[0][s->block_index[i] - 2 + v->blocks_off], |
| 568 | 568 | ttblk, |
| @@ -583,7 +583,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 14 unmodified lines | ||
| 583 | 583 | cbp, |
| 584 | 584 | is_intra, |
| 585 | 585 | i > 3 ? uvmv : |
| 586 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], | |
| 586 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], | |
| 587 | 587 | i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride + v->mb_off] : |
| 588 | 588 | &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], |
| 589 | 589 | ttblk, |
| @@ -602,7 +602,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 12 unmodified lines | ||
| 602 | 602 | cbp, |
| 603 | 603 | is_intra, |
| 604 | 604 | i > 3 ? uvmv : |
| 605 | − &s->current_picture.motion_val[0][s->block_index[i] + v->blocks_off], | |
| 605 | + &s->cur_pic.motion_val[0][s->block_index[i] + v->blocks_off], | |
| 606 | 606 | i > 3 ? &v->mv_f[0][s->block_index[i] + v->mb_off] : |
| 607 | 607 | &v->mv_f[0][s->block_index[i] + v->blocks_off], |
| 608 | 608 | ttblk, |
| @@ -625,7 +625,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 16 unmodified lines | ||
| 625 | 625 | cbp, |
| 626 | 626 | is_intra, |
| 627 | 627 | i > 3 ? uvmv : |
| 628 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], | |
| 628 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], | |
| 629 | 629 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 2 + v->mb_off] : |
| 630 | 630 | &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 4 + v->blocks_off], |
| 631 | 631 | ttblk, |
| @@ -646,7 +646,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 14 unmodified lines | ||
| 646 | 646 | cbp, |
| 647 | 647 | is_intra, |
| 648 | 648 | i > 3 ? uvmv : |
| 649 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], | |
| 649 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], | |
| 650 | 650 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride - 1 + v->mb_off] : |
| 651 | 651 | &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride - 2 + v->blocks_off], |
| 652 | 652 | ttblk, |
| @@ -665,7 +665,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 12 unmodified lines | ||
| 665 | 665 | cbp, |
| 666 | 666 | is_intra, |
| 667 | 667 | i > 3 ? uvmv : |
| 668 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], | |
| 668 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], | |
| 669 | 669 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 * s->mb_stride + v->mb_off] : |
| 670 | 670 | &v->mv_f[0][s->block_index[i] - 4 * s->b8_stride + v->blocks_off], |
| 671 | 671 | ttblk, |
| @@ -688,7 +688,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 16 unmodified lines | ||
| 688 | 688 | cbp, |
| 689 | 689 | is_intra, |
| 690 | 690 | i > 3 ? uvmv : |
| 691 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], | |
| 691 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], | |
| 692 | 692 | i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 2 + v->mb_off] : |
| 693 | 693 | &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 4 + v->blocks_off], |
| 694 | 694 | ttblk, |
| @@ -709,7 +709,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 14 unmodified lines | ||
| 709 | 709 | cbp, |
| 710 | 710 | is_intra, |
| 711 | 711 | i > 3 ? uvmv : |
| 712 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], | |
| 712 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], | |
| 713 | 713 | i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride - 1 + v->mb_off] : |
| 714 | 714 | &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride - 2 + v->blocks_off], |
| 715 | 715 | ttblk, |
| @@ -728,7 +728,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 12 unmodified lines | ||
| 728 | 728 | cbp, |
| 729 | 729 | is_intra, |
| 730 | 730 | i > 3 ? uvmv : |
| 731 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], | |
| 731 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], | |
| 732 | 732 | i > 3 ? &v->mv_f[0][s->block_index[i] - s->mb_stride + v->mb_off] : |
| 733 | 733 | &v->mv_f[0][s->block_index[i] - 2 * s->b8_stride + v->blocks_off], |
| 734 | 734 | ttblk, |
| @@ -749,7 +749,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 14 unmodified lines | ||
| 749 | 749 | cbp, |
| 750 | 750 | is_intra, |
| 751 | 751 | i > 3 ? uvmv : |
| 752 | − &s->current_picture.motion_val[0][s->block_index[i] - 4 + v->blocks_off], | |
| 752 | + &s->cur_pic.motion_val[0][s->block_index[i] - 4 + v->blocks_off], | |
| 753 | 753 | i > 3 ? &v->mv_f[0][s->block_index[i] - 2 + v->mb_off] : |
| 754 | 754 | &v->mv_f[0][s->block_index[i] - 4 + v->blocks_off], |
| 755 | 755 | ttblk, |
| @@ -770,7 +770,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 14 unmodified lines | ||
| 770 | 770 | cbp, |
| 771 | 771 | is_intra, |
| 772 | 772 | i > 3 ? uvmv : |
| 773 | − &s->current_picture.motion_val[0][s->block_index[i] - 2 + v->blocks_off], | |
| 773 | + &s->cur_pic.motion_val[0][s->block_index[i] - 2 + v->blocks_off], | |
| 774 | 774 | i > 3 ? &v->mv_f[0][s->block_index[i] - 1 + v->mb_off] : |
| 775 | 775 | &v->mv_f[0][s->block_index[i] - 2 + v->blocks_off], |
| 776 | 776 | ttblk, |
| @@ -789,7 +789,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) · 12 unmodified lines | ||
| 789 | 789 | cbp, |
| 790 | 790 | is_intra, |
| 791 | 791 | i > 3 ? uvmv : |
| 792 | − &s->current_picture.motion_val[0][s->block_index[i] + v->blocks_off], | |
| 792 | + &s->cur_pic.motion_val[0][s->block_index[i] + v->blocks_off], | |
| 793 | 793 | i > 3 ? &v->mv_f[0][s->block_index[i] + v->mb_off] : |
| 794 | 794 | &v->mv_f[0][s->block_index[i] + v->blocks_off], |
| 795 | 795 | ttblk, |
| @@ -184,11 +184,11 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) · 183 unmodified lines | ||
| 184 | 184 | |
| 185 | 185 | if ((!v->field_mode || |
| 186 | 186 | (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) && |
| 187 | − !v->s.last_picture.f->data[0]) | |
| 187 | + !v->s.last_pic.f->data[0]) | |
| 188 | 188 | return; |
| 189 | 189 | |
| 190 | − linesize = s->current_picture_ptr->f->linesize[0]; | |
| 191 | − uvlinesize = s->current_picture_ptr->f->linesize[1]; | |
| 190 | + linesize = s->cur_pic_ptr->f->linesize[0]; | |
| 191 | + uvlinesize = s->cur_pic_ptr->f->linesize[1]; | |
| 192 | 192 | |
| 193 | 193 | mx = s->mv[dir][0][0]; |
| 194 | 194 | my = s->mv[dir][0][1]; |
| @@ -196,8 +196,8 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) · 1 unmodified line | ||
| 196 | 196 | // store motion vectors for further use in B-frames |
| 197 | 197 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 198 | 198 | for (i = 0; i < 4; i++) { |
| 199 | − s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = mx; | |
| 200 | − s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = my; | |
| 199 | + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][0] = mx; | |
| 200 | + s->cur_pic.motion_val[1][s->block_index[i] + v->blocks_off][1] = my; | |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| @@ -219,30 +219,30 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir) · 15 unmodified lines | ||
| 219 | 219 | } |
| 220 | 220 | if (!dir) { |
| 221 | 221 | if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) { |
| 222 | − srcY = s->current_picture.f->data[0]; | |
| 223 | − srcU = s->current_picture.f->data[1]; | |
| 224 | − srcV = s->current_picture.f->data[2]; | |
| 222 | + srcY = s->cur_pic.f->data[0]; | |
| 223 | + srcU = s->cur_pic.f->data[1]; | |
| 224 | + srcV = s->cur_pic.f->data[2]; | |
| 225 | 225 | luty = v->curr_luty; |
| 226 | 226 | lutuv = v->curr_lutuv; |
| 227 | 227 | use_ic = *v->curr_use_ic; |
| 228 | 228 | interlace = 1; |
| 229 | 229 | } else { |
| 230 | − srcY = s->last_picture.f->data[0]; | |
| 231 | − srcU = s->last_picture.f->data[1]; | |
| 232 | − srcV = s->last_picture.f->data[2]; | |
| 230 | + srcY = s->last_pic.f->data[0]; | |
| 231 | + srcU = s->last_pic.f->data[1]; | |
| 232 | + srcV = s->last_pic.f->data[2]; | |
| 233 | 233 | luty = v->last_luty; |
| 234 | 234 | lutuv = v->last_lutuv; |
| 235 | 235 | use_ic = v->last_use_ic; |
| 236 | − interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 236 | + interlace = !!(s->last_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 237 | 237 | } |
| 238 | 238 | } else { |
| 239 | − srcY = s->next_picture.f->data[0]; | |
| 240 | − srcU = s->next_picture.f->data[1]; | |
| 241 | − srcV = s->next_picture.f->data[2]; | |
| 239 | + srcY = s->next_pic.f->data[0]; | |
| 240 | + srcU = s->next_pic.f->data[1]; | |
| 241 | + srcV = s->next_pic.f->data[2]; | |
| 242 | 242 | luty = v->next_luty; |
| 243 | 243 | lutuv = v->next_lutuv; |
| 244 | 244 | use_ic = v->next_use_ic; |
| 245 | − interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 245 | + interlace = !!(s->next_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | if (!srcY || !srcU) { |
| @@ -464,31 +464,31 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) · 215 unmodified lines | ||
| 464 | 464 | |
| 465 | 465 | if ((!v->field_mode || |
| 466 | 466 | (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) && |
| 467 | − !v->s.last_picture.f->data[0]) | |
| 467 | + !v->s.last_pic.f->data[0]) | |
| 468 | 468 | return; |
| 469 | 469 | |
| 470 | − linesize = s->current_picture_ptr->f->linesize[0]; | |
| 470 | + linesize = s->cur_pic_ptr->f->linesize[0]; | |
| 471 | 471 | |
| 472 | 472 | mx = s->mv[dir][n][0]; |
| 473 | 473 | my = s->mv[dir][n][1]; |
| 474 | 474 | |
| 475 | 475 | if (!dir) { |
| 476 | 476 | if (v->field_mode && (v->cur_field_type != v->ref_field_type[dir]) && v->second_field) { |
| 477 | − srcY = s->current_picture.f->data[0]; | |
| 477 | + srcY = s->cur_pic.f->data[0]; | |
| 478 | 478 | luty = v->curr_luty; |
| 479 | 479 | use_ic = *v->curr_use_ic; |
| 480 | 480 | interlace = 1; |
| 481 | 481 | } else { |
| 482 | − srcY = s->last_picture.f->data[0]; | |
| 482 | + srcY = s->last_pic.f->data[0]; | |
| 483 | 483 | luty = v->last_luty; |
| 484 | 484 | use_ic = v->last_use_ic; |
| 485 | − interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 485 | + interlace = !!(s->last_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 486 | 486 | } |
| 487 | 487 | } else { |
| 488 | − srcY = s->next_picture.f->data[0]; | |
| 488 | + srcY = s->next_pic.f->data[0]; | |
| 489 | 489 | luty = v->next_luty; |
| 490 | 490 | use_ic = v->next_use_ic; |
| 491 | − interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 491 | + interlace = !!(s->next_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | if (!srcY) { |
| @@ -503,8 +503,8 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) · 8 unmodified lines | ||
| 503 | 503 | |
| 504 | 504 | if (s->pict_type == AV_PICTURE_TYPE_P && n == 3 && v->field_mode) { |
| 505 | 505 | int opp_count = get_luma_mv(v, 0, |
| 506 | − &s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 507 | − &s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1]); | |
| 506 | + &s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 507 | + &s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1]); | |
| 508 | 508 | int k, f = opp_count > 2; |
| 509 | 509 | for (k = 0; k < 4; k++) |
| 510 | 510 | v->mv_f[1][s->block_index[k] + v->blocks_off] = f; |
| @@ -515,8 +515,8 @@ void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg) · 4 unmodified lines | ||
| 515 | 515 | int width = s->avctx->coded_width; |
| 516 | 516 | int height = s->avctx->coded_height >> 1; |
| 517 | 517 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 518 | − s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][0] = mx; | |
| 519 | − s->current_picture.motion_val[1][s->block_index[n] + v->blocks_off][1] = my; | |
| 518 | + s->cur_pic.motion_val[1][s->block_index[n] + v->blocks_off][0] = mx; | |
| 519 | + s->cur_pic.motion_val[1][s->block_index[n] + v->blocks_off][1] = my; | |
| 520 | 520 | } |
| 521 | 521 | qx = (s->mb_x * 16) + (mx >> 2); |
| 522 | 522 | qy = (s->mb_y * 8) + (my >> 3); |
| @@ -645,7 +645,7 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) · 122 unmodified lines | ||
| 645 | 645 | int interlace; |
| 646 | 646 | int uvlinesize; |
| 647 | 647 | |
| 648 | − if (!v->field_mode && !v->s.last_picture.f->data[0]) | |
| 648 | + if (!v->field_mode && !v->s.last_pic.f->data[0]) | |
| 649 | 649 | return; |
| 650 | 650 | if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) |
| 651 | 651 | return; |
| @@ -654,8 +654,8 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) · 2 unmodified lines | ||
| 654 | 654 | if (!v->field_mode || !v->numref) { |
| 655 | 655 | int valid_count = get_chroma_mv(v, dir, &tx, &ty); |
| 656 | 656 | if (!valid_count) { |
| 657 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; | |
| 658 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; | |
| 657 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; | |
| 658 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; | |
| 659 | 659 | v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; |
| 660 | 660 | return; //no need to do MC for intra blocks |
| 661 | 661 | } |
| @@ -664,12 +664,12 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) · 2 unmodified lines | ||
| 664 | 664 | int opp_count = get_luma_mv(v, dir, &tx, &ty); |
| 665 | 665 | chroma_ref_type = v->cur_field_type ^ (opp_count > 2); |
| 666 | 666 | } |
| 667 | − if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f->data[0]) | |
| 667 | + if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_pic.f->data[0]) | |
| 668 | 668 | return; |
| 669 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx; | |
| 670 | − s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty; | |
| 669 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx; | |
| 670 | + s->cur_pic.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty; | |
| 671 | 671 | |
| 672 | − uvlinesize = s->current_picture_ptr->f->linesize[1]; | |
| 672 | + uvlinesize = s->cur_pic_ptr->f->linesize[1]; | |
| 673 | 673 | |
| 674 | 674 | uvmx = (tx + ((tx & 3) == 3)) >> 1; |
| 675 | 675 | uvmy = (ty + ((ty & 3) == 3)) >> 1; |
| @@ -698,24 +698,24 @@ void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir) · 22 unmodified lines | ||
| 698 | 698 | |
| 699 | 699 | if (!dir) { |
| 700 | 700 | if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) { |
| 701 | − srcU = s->current_picture.f->data[1]; | |
| 702 | − srcV = s->current_picture.f->data[2]; | |
| 701 | + srcU = s->cur_pic.f->data[1]; | |
| 702 | + srcV = s->cur_pic.f->data[2]; | |
| 703 | 703 | lutuv = v->curr_lutuv; |
| 704 | 704 | use_ic = *v->curr_use_ic; |
| 705 | 705 | interlace = 1; |
| 706 | 706 | } else { |
| 707 | − srcU = s->last_picture.f->data[1]; | |
| 708 | − srcV = s->last_picture.f->data[2]; | |
| 707 | + srcU = s->last_pic.f->data[1]; | |
| 708 | + srcV = s->last_pic.f->data[2]; | |
| 709 | 709 | lutuv = v->last_lutuv; |
| 710 | 710 | use_ic = v->last_use_ic; |
| 711 | − interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 711 | + interlace = !!(s->last_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 712 | 712 | } |
| 713 | 713 | } else { |
| 714 | − srcU = s->next_picture.f->data[1]; | |
| 715 | − srcV = s->next_picture.f->data[2]; | |
| 714 | + srcU = s->next_pic.f->data[1]; | |
| 715 | + srcV = s->next_pic.f->data[2]; | |
| 716 | 716 | lutuv = v->next_lutuv; |
| 717 | 717 | use_ic = v->next_use_ic; |
| 718 | − interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 718 | + interlace = !!(s->next_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | if (!srcU) { |
| @@ -856,7 +856,7 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg) · 134 unmodified lines | ||
| 856 | 856 | if (CONFIG_GRAY && s->avctx->flags & AV_CODEC_FLAG_GRAY) |
| 857 | 857 | return; |
| 858 | 858 | |
| 859 | − uvlinesize = s->current_picture_ptr->f->linesize[1]; | |
| 859 | + uvlinesize = s->cur_pic_ptr->f->linesize[1]; | |
| 860 | 860 | |
| 861 | 861 | for (i = 0; i < 4; i++) { |
| 862 | 862 | int d = i < 2 ? dir: dir2; |
| @@ -880,17 +880,17 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg) · 17 unmodified lines | ||
| 880 | 880 | else |
| 881 | 881 | uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1); |
| 882 | 882 | if (i < 2 ? dir : dir2) { |
| 883 | − srcU = s->next_picture.f->data[1]; | |
| 884 | − srcV = s->next_picture.f->data[2]; | |
| 883 | + srcU = s->next_pic.f->data[1]; | |
| 884 | + srcV = s->next_pic.f->data[2]; | |
| 885 | 885 | lutuv = v->next_lutuv; |
| 886 | 886 | use_ic = v->next_use_ic; |
| 887 | − interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 887 | + interlace = !!(s->next_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 888 | 888 | } else { |
| 889 | − srcU = s->last_picture.f->data[1]; | |
| 890 | − srcV = s->last_picture.f->data[2]; | |
| 889 | + srcU = s->last_pic.f->data[1]; | |
| 890 | + srcV = s->last_pic.f->data[2]; | |
| 891 | 891 | lutuv = v->last_lutuv; |
| 892 | 892 | use_ic = v->last_use_ic; |
| 893 | − interlace = !!(s->last_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 893 | + interlace = !!(s->last_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 894 | 894 | } |
| 895 | 895 | if (!srcU) |
| 896 | 896 | return; |
| @@ -1012,11 +1012,11 @@ void ff_vc1_interp_mc(VC1Context *v) · 115 unmodified lines | ||
| 1012 | 1012 | int interlace; |
| 1013 | 1013 | int linesize, uvlinesize; |
| 1014 | 1014 | |
| 1015 | − if (!v->field_mode && !v->s.next_picture.f->data[0]) | |
| 1015 | + if (!v->field_mode && !v->s.next_pic.f->data[0]) | |
| 1016 | 1016 | return; |
| 1017 | 1017 | |
| 1018 | − linesize = s->current_picture_ptr->f->linesize[0]; | |
| 1019 | − uvlinesize = s->current_picture_ptr->f->linesize[1]; | |
| 1018 | + linesize = s->cur_pic_ptr->f->linesize[0]; | |
| 1019 | + uvlinesize = s->cur_pic_ptr->f->linesize[1]; | |
| 1020 | 1020 | |
| 1021 | 1021 | mx = s->mv[1][0][0]; |
| 1022 | 1022 | my = s->mv[1][0][1]; |
| @@ -1030,11 +1030,11 @@ void ff_vc1_interp_mc(VC1Context *v) · 7 unmodified lines | ||
| 1030 | 1030 | uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1)); |
| 1031 | 1031 | uvmy = uvmy + ((uvmy < 0) ? -(uvmy & 1) : (uvmy & 1)); |
| 1032 | 1032 | } |
| 1033 | − srcY = s->next_picture.f->data[0]; | |
| 1034 | − srcU = s->next_picture.f->data[1]; | |
| 1035 | − srcV = s->next_picture.f->data[2]; | |
| 1033 | + srcY = s->next_pic.f->data[0]; | |
| 1034 | + srcU = s->next_pic.f->data[1]; | |
| 1035 | + srcV = s->next_pic.f->data[2]; | |
| 1036 | 1036 | |
| 1037 | − interlace = !!(s->next_picture.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 1037 | + interlace = !!(s->next_pic.f->flags & AV_FRAME_FLAG_INTERLACED); | |
| 1038 | 1038 | |
| 1039 | 1039 | src_x = s->mb_x * 16 + (mx >> 2); |
| 1040 | 1040 | src_y = s->mb_y * 16 + (my >> 2); |
| @@ -241,24 +241,24 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, · 240 unmodified lines | ||
| 241 | 241 | xy = s->block_index[n]; |
| 242 | 242 | |
| 243 | 243 | if (s->mb_intra) { |
| 244 | − s->mv[0][n][0] = s->current_picture.motion_val[0][xy + v->blocks_off][0] = 0; | |
| 245 | − s->mv[0][n][1] = s->current_picture.motion_val[0][xy + v->blocks_off][1] = 0; | |
| 246 | − s->current_picture.motion_val[1][xy + v->blocks_off][0] = 0; | |
| 247 | − s->current_picture.motion_val[1][xy + v->blocks_off][1] = 0; | |
| 244 | + s->mv[0][n][0] = s->cur_pic.motion_val[0][xy + v->blocks_off][0] = 0; | |
| 245 | + s->mv[0][n][1] = s->cur_pic.motion_val[0][xy + v->blocks_off][1] = 0; | |
| 246 | + s->cur_pic.motion_val[1][xy + v->blocks_off][0] = 0; | |
| 247 | + s->cur_pic.motion_val[1][xy + v->blocks_off][1] = 0; | |
| 248 | 248 | if (mv1) { /* duplicate motion data for 1-MV block */ |
| 249 | − s->current_picture.motion_val[0][xy + 1 + v->blocks_off][0] = 0; | |
| 250 | − s->current_picture.motion_val[0][xy + 1 + v->blocks_off][1] = 0; | |
| 251 | − s->current_picture.motion_val[0][xy + wrap + v->blocks_off][0] = 0; | |
| 252 | − s->current_picture.motion_val[0][xy + wrap + v->blocks_off][1] = 0; | |
| 253 | − s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][0] = 0; | |
| 254 | − s->current_picture.motion_val[0][xy + wrap + 1 + v->blocks_off][1] = 0; | |
| 249 | + s->cur_pic.motion_val[0][xy + 1 + v->blocks_off][0] = 0; | |
| 250 | + s->cur_pic.motion_val[0][xy + 1 + v->blocks_off][1] = 0; | |
| 251 | + s->cur_pic.motion_val[0][xy + wrap + v->blocks_off][0] = 0; | |
| 252 | + s->cur_pic.motion_val[0][xy + wrap + v->blocks_off][1] = 0; | |
| 253 | + s->cur_pic.motion_val[0][xy + wrap + 1 + v->blocks_off][0] = 0; | |
| 254 | + s->cur_pic.motion_val[0][xy + wrap + 1 + v->blocks_off][1] = 0; | |
| 255 | 255 | v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; |
| 256 | − s->current_picture.motion_val[1][xy + 1 + v->blocks_off][0] = 0; | |
| 257 | − s->current_picture.motion_val[1][xy + 1 + v->blocks_off][1] = 0; | |
| 258 | − s->current_picture.motion_val[1][xy + wrap + v->blocks_off][0] = 0; | |
| 259 | − s->current_picture.motion_val[1][xy + wrap + v->blocks_off][1] = 0; | |
| 260 | − s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][0] = 0; | |
| 261 | − s->current_picture.motion_val[1][xy + wrap + 1 + v->blocks_off][1] = 0; | |
| 256 | + s->cur_pic.motion_val[1][xy + 1 + v->blocks_off][0] = 0; | |
| 257 | + s->cur_pic.motion_val[1][xy + 1 + v->blocks_off][1] = 0; | |
| 258 | + s->cur_pic.motion_val[1][xy + wrap + v->blocks_off][0] = 0; | |
| 259 | + s->cur_pic.motion_val[1][xy + wrap + v->blocks_off][1] = 0; | |
| 260 | + s->cur_pic.motion_val[1][xy + wrap + 1 + v->blocks_off][0] = 0; | |
| 261 | + s->cur_pic.motion_val[1][xy + wrap + 1 + v->blocks_off][1] = 0; | |
| 262 | 262 | } |
| 263 | 263 | return; |
| 264 | 264 | } |
| @@ -301,7 +301,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, · 36 unmodified lines | ||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | if (a_valid) { |
| 304 | − A = s->current_picture.motion_val[dir][xy - wrap + v->blocks_off]; | |
| 304 | + A = s->cur_pic.motion_val[dir][xy - wrap + v->blocks_off]; | |
| 305 | 305 | a_f = v->mv_f[dir][xy - wrap + v->blocks_off]; |
| 306 | 306 | num_oppfield += a_f; |
| 307 | 307 | num_samefield += 1 - a_f; |
| @@ -312,7 +312,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, · 4 unmodified lines | ||
| 312 | 312 | a_f = 0; |
| 313 | 313 | } |
| 314 | 314 | if (b_valid) { |
| 315 | − B = s->current_picture.motion_val[dir][xy - wrap + off + v->blocks_off]; | |
| 315 | + B = s->cur_pic.motion_val[dir][xy - wrap + off + v->blocks_off]; | |
| 316 | 316 | b_f = v->mv_f[dir][xy - wrap + off + v->blocks_off]; |
| 317 | 317 | num_oppfield += b_f; |
| 318 | 318 | num_samefield += 1 - b_f; |
| @@ -323,7 +323,7 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, · 4 unmodified lines | ||
| 323 | 323 | b_f = 0; |
| 324 | 324 | } |
| 325 | 325 | if (c_valid) { |
| 326 | − C = s->current_picture.motion_val[dir][xy - 1 + v->blocks_off]; | |
| 326 | + C = s->cur_pic.motion_val[dir][xy - 1 + v->blocks_off]; | |
| 327 | 327 | c_f = v->mv_f[dir][xy - 1 + v->blocks_off]; |
| 328 | 328 | num_oppfield += c_f; |
| 329 | 329 | num_samefield += 1 - c_f; |
| @@ -451,15 +451,15 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, · 121 unmodified lines | ||
| 451 | 451 | if (v->field_mode && v->cur_field_type && v->ref_field_type[dir] == 0) |
| 452 | 452 | y_bias = 1; |
| 453 | 453 | /* store MV using signed modulus of MV range defined in 4.11 */ |
| 454 | − s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; | |
| 455 | − s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1] = ((py + dmv_y + r_y - y_bias) & ((r_y << 1) - 1)) - r_y + y_bias; | |
| 454 | + s->mv[dir][n][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; | |
| 455 | + s->mv[dir][n][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1] = ((py + dmv_y + r_y - y_bias) & ((r_y << 1) - 1)) - r_y + y_bias; | |
| 456 | 456 | if (mv1) { /* duplicate motion data for 1-MV block */ |
| 457 | − s->current_picture.motion_val[dir][xy + 1 + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; | |
| 458 | − s->current_picture.motion_val[dir][xy + 1 + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; | |
| 459 | − s->current_picture.motion_val[dir][xy + wrap + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; | |
| 460 | − s->current_picture.motion_val[dir][xy + wrap + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; | |
| 461 | − s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][0] = s->current_picture.motion_val[dir][xy + v->blocks_off][0]; | |
| 462 | − s->current_picture.motion_val[dir][xy + wrap + 1 + v->blocks_off][1] = s->current_picture.motion_val[dir][xy + v->blocks_off][1]; | |
| 457 | + s->cur_pic.motion_val[dir][xy + 1 + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; | |
| 458 | + s->cur_pic.motion_val[dir][xy + 1 + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; | |
| 459 | + s->cur_pic.motion_val[dir][xy + wrap + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; | |
| 460 | + s->cur_pic.motion_val[dir][xy + wrap + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; | |
| 461 | + s->cur_pic.motion_val[dir][xy + wrap + 1 + v->blocks_off][0] = s->cur_pic.motion_val[dir][xy + v->blocks_off][0]; | |
| 462 | + s->cur_pic.motion_val[dir][xy + wrap + 1 + v->blocks_off][1] = s->cur_pic.motion_val[dir][xy + v->blocks_off][1]; | |
| 463 | 463 | v->mv_f[dir][xy + 1 + v->blocks_off] = v->mv_f[dir][xy + v->blocks_off]; |
| 464 | 464 | v->mv_f[dir][xy + wrap + v->blocks_off] = v->mv_f[dir][xy + wrap + 1 + v->blocks_off] = v->mv_f[dir][xy + v->blocks_off]; |
| 465 | 465 | } |
| @@ -483,24 +483,24 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 17 unmodified lines | ||
| 483 | 483 | xy = s->block_index[n]; |
| 484 | 484 | |
| 485 | 485 | if (s->mb_intra) { |
| 486 | − s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0; | |
| 487 | − s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0; | |
| 488 | − s->current_picture.motion_val[1][xy][0] = 0; | |
| 489 | − s->current_picture.motion_val[1][xy][1] = 0; | |
| 486 | + s->mv[0][n][0] = s->cur_pic.motion_val[0][xy][0] = 0; | |
| 487 | + s->mv[0][n][1] = s->cur_pic.motion_val[0][xy][1] = 0; | |
| 488 | + s->cur_pic.motion_val[1][xy][0] = 0; | |
| 489 | + s->cur_pic.motion_val[1][xy][1] = 0; | |
| 490 | 490 | if (mvn == 1) { /* duplicate motion data for 1-MV block */ |
| 491 | − s->current_picture.motion_val[0][xy + 1][0] = 0; | |
| 492 | − s->current_picture.motion_val[0][xy + 1][1] = 0; | |
| 493 | − s->current_picture.motion_val[0][xy + wrap][0] = 0; | |
| 494 | − s->current_picture.motion_val[0][xy + wrap][1] = 0; | |
| 495 | − s->current_picture.motion_val[0][xy + wrap + 1][0] = 0; | |
| 496 | − s->current_picture.motion_val[0][xy + wrap + 1][1] = 0; | |
| 491 | + s->cur_pic.motion_val[0][xy + 1][0] = 0; | |
| 492 | + s->cur_pic.motion_val[0][xy + 1][1] = 0; | |
| 493 | + s->cur_pic.motion_val[0][xy + wrap][0] = 0; | |
| 494 | + s->cur_pic.motion_val[0][xy + wrap][1] = 0; | |
| 495 | + s->cur_pic.motion_val[0][xy + wrap + 1][0] = 0; | |
| 496 | + s->cur_pic.motion_val[0][xy + wrap + 1][1] = 0; | |
| 497 | 497 | v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; |
| 498 | − s->current_picture.motion_val[1][xy + 1][0] = 0; | |
| 499 | − s->current_picture.motion_val[1][xy + 1][1] = 0; | |
| 500 | − s->current_picture.motion_val[1][xy + wrap][0] = 0; | |
| 501 | − s->current_picture.motion_val[1][xy + wrap][1] = 0; | |
| 502 | − s->current_picture.motion_val[1][xy + wrap + 1][0] = 0; | |
| 503 | − s->current_picture.motion_val[1][xy + wrap + 1][1] = 0; | |
| 498 | + s->cur_pic.motion_val[1][xy + 1][0] = 0; | |
| 499 | + s->cur_pic.motion_val[1][xy + 1][1] = 0; | |
| 500 | + s->cur_pic.motion_val[1][xy + wrap][0] = 0; | |
| 501 | + s->cur_pic.motion_val[1][xy + wrap][1] = 0; | |
| 502 | + s->cur_pic.motion_val[1][xy + wrap + 1][0] = 0; | |
| 503 | + s->cur_pic.motion_val[1][xy + wrap + 1][1] = 0; | |
| 504 | 504 | } |
| 505 | 505 | return; |
| 506 | 506 | } |
| @@ -510,14 +510,14 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 3 unmodified lines | ||
| 510 | 510 | if (s->mb_x || (n == 1) || (n == 3)) { |
| 511 | 511 | if ((v->blk_mv_type[xy]) // current block (MB) has a field MV |
| 512 | 512 | || (!v->blk_mv_type[xy] && !v->blk_mv_type[xy - 1])) { // or both have frame MV |
| 513 | − A[0] = s->current_picture.motion_val[dir][xy - 1][0]; | |
| 514 | − A[1] = s->current_picture.motion_val[dir][xy - 1][1]; | |
| 513 | + A[0] = s->cur_pic.motion_val[dir][xy - 1][0]; | |
| 514 | + A[1] = s->cur_pic.motion_val[dir][xy - 1][1]; | |
| 515 | 515 | a_valid = 1; |
| 516 | 516 | } else { // current block has frame mv and cand. has field MV (so average) |
| 517 | − A[0] = (s->current_picture.motion_val[dir][xy - 1][0] | |
| 518 | − + s->current_picture.motion_val[dir][xy - 1 + off * wrap][0] + 1) >> 1; | |
| 519 | − A[1] = (s->current_picture.motion_val[dir][xy - 1][1] | |
| 520 | − + s->current_picture.motion_val[dir][xy - 1 + off * wrap][1] + 1) >> 1; | |
| 517 | + A[0] = (s->cur_pic.motion_val[dir][xy - 1][0] | |
| 518 | + + s->cur_pic.motion_val[dir][xy - 1 + off * wrap][0] + 1) >> 1; | |
| 519 | + A[1] = (s->cur_pic.motion_val[dir][xy - 1][1] | |
| 520 | + + s->cur_pic.motion_val[dir][xy - 1 + off * wrap][1] + 1) >> 1; | |
| 521 | 521 | a_valid = 1; |
| 522 | 522 | } |
| 523 | 523 | if (!(n & 1) && v->is_intra[s->mb_x - 1]) { |
| @@ -537,11 +537,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 13 unmodified lines | ||
| 537 | 537 | if (v->blk_mv_type[pos_b] && v->blk_mv_type[xy]) { |
| 538 | 538 | n_adj = (n & 2) | (n & 1); |
| 539 | 539 | } |
| 540 | − B[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][0]; | |
| 541 | − B[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap][1]; | |
| 540 | + B[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap][0]; | |
| 541 | + B[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap][1]; | |
| 542 | 542 | if (v->blk_mv_type[pos_b] && !v->blk_mv_type[xy]) { |
| 543 | − B[0] = (B[0] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1; | |
| 544 | − B[1] = (B[1] + s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1; | |
| 543 | + B[0] = (B[0] + s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1; | |
| 544 | + B[1] = (B[1] + s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1; | |
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | if (s->mb_width > 1) { |
| @@ -552,11 +552,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 4 unmodified lines | ||
| 552 | 552 | if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) { |
| 553 | 553 | n_adj = n & 2; |
| 554 | 554 | } |
| 555 | − C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][0]; | |
| 556 | − C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][1]; | |
| 555 | + C[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][0]; | |
| 556 | + C[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap + 2][1]; | |
| 557 | 557 | if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) { |
| 558 | − C[0] = (1 + C[0] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1; | |
| 559 | − C[1] = (1 + C[1] + (s->current_picture.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1; | |
| 558 | + C[0] = (1 + C[0] + (s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1; | |
| 559 | + C[1] = (1 + C[1] + (s->cur_pic.motion_val[dir][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1; | |
| 560 | 560 | } |
| 561 | 561 | if (s->mb_x == s->mb_width - 1) { |
| 562 | 562 | if (!v->is_intra[s->mb_x - s->mb_stride - 1]) { |
| @@ -566,11 +566,11 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 3 unmodified lines | ||
| 566 | 566 | if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) { |
| 567 | 567 | n_adj = n | 1; |
| 568 | 568 | } |
| 569 | − C[0] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][0]; | |
| 570 | − C[1] = s->current_picture.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][1]; | |
| 569 | + C[0] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][0]; | |
| 570 | + C[1] = s->cur_pic.motion_val[dir][s->block_index[n_adj] - 2 * wrap - 2][1]; | |
| 571 | 571 | if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) { |
| 572 | − C[0] = (1 + C[0] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][0]) >> 1; | |
| 573 | − C[1] = (1 + C[1] + s->current_picture.motion_val[dir][s->block_index[1] - 2 * wrap - 2][1]) >> 1; | |
| 572 | + C[0] = (1 + C[0] + s->cur_pic.motion_val[dir][s->block_index[1] - 2 * wrap - 2][0]) >> 1; | |
| 573 | + C[1] = (1 + C[1] + s->cur_pic.motion_val[dir][s->block_index[1] - 2 * wrap - 2][1]) >> 1; | |
| 574 | 574 | } |
| 575 | 575 | } else |
| 576 | 576 | c_valid = 0; |
| @@ -581,12 +581,12 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 4 unmodified lines | ||
| 581 | 581 | } else { |
| 582 | 582 | pos_b = s->block_index[1]; |
| 583 | 583 | b_valid = 1; |
| 584 | − B[0] = s->current_picture.motion_val[dir][pos_b][0]; | |
| 585 | − B[1] = s->current_picture.motion_val[dir][pos_b][1]; | |
| 584 | + B[0] = s->cur_pic.motion_val[dir][pos_b][0]; | |
| 585 | + B[1] = s->cur_pic.motion_val[dir][pos_b][1]; | |
| 586 | 586 | pos_c = s->block_index[0]; |
| 587 | 587 | c_valid = 1; |
| 588 | − C[0] = s->current_picture.motion_val[dir][pos_c][0]; | |
| 589 | − C[1] = s->current_picture.motion_val[dir][pos_c][1]; | |
| 588 | + C[0] = s->cur_pic.motion_val[dir][pos_c][0]; | |
| 589 | + C[1] = s->cur_pic.motion_val[dir][pos_c][1]; | |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | total_valid = a_valid + b_valid + c_valid; |
| @@ -671,18 +671,18 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, · 78 unmodified lines | ||
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | /* store MV using signed modulus of MV range defined in 4.11 */ |
| 674 | − s->mv[dir][n][0] = s->current_picture.motion_val[dir][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; | |
| 675 | − s->mv[dir][n][1] = s->current_picture.motion_val[dir][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y; | |
| 674 | + s->mv[dir][n][0] = s->cur_pic.motion_val[dir][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x; | |
| 675 | + s->mv[dir][n][1] = s->cur_pic.motion_val[dir][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y; | |
| 676 | 676 | if (mvn == 1) { /* duplicate motion data for 1-MV block */ |
| 677 | − s->current_picture.motion_val[dir][xy + 1 ][0] = s->current_picture.motion_val[dir][xy][0]; | |
| 678 | − s->current_picture.motion_val[dir][xy + 1 ][1] = s->current_picture.motion_val[dir][xy][1]; | |
| 679 | − s->current_picture.motion_val[dir][xy + wrap ][0] = s->current_picture.motion_val[dir][xy][0]; | |
| 680 | − s->current_picture.motion_val[dir][xy + wrap ][1] = s->current_picture.motion_val[dir][xy][1]; | |
| 681 | − s->current_picture.motion_val[dir][xy + wrap + 1][0] = s->current_picture.motion_val[dir][xy][0]; | |
| 682 | − s->current_picture.motion_val[dir][xy + wrap + 1][1] = s->current_picture.motion_val[dir][xy][1]; | |
| 677 | + s->cur_pic.motion_val[dir][xy + 1 ][0] = s->cur_pic.motion_val[dir][xy][0]; | |
| 678 | + s->cur_pic.motion_val[dir][xy + 1 ][1] = s->cur_pic.motion_val[dir][xy][1]; | |
| 679 | + s->cur_pic.motion_val[dir][xy + wrap ][0] = s->cur_pic.motion_val[dir][xy][0]; | |
| 680 | + s->cur_pic.motion_val[dir][xy + wrap ][1] = s->cur_pic.motion_val[dir][xy][1]; | |
| 681 | + s->cur_pic.motion_val[dir][xy + wrap + 1][0] = s->cur_pic.motion_val[dir][xy][0]; | |
| 682 | + s->cur_pic.motion_val[dir][xy + wrap + 1][1] = s->cur_pic.motion_val[dir][xy][1]; | |
| 683 | 683 | } else if (mvn == 2) { /* duplicate motion data for 2-Field MV block */ |
| 684 | − s->current_picture.motion_val[dir][xy + 1][0] = s->current_picture.motion_val[dir][xy][0]; | |
| 685 | − s->current_picture.motion_val[dir][xy + 1][1] = s->current_picture.motion_val[dir][xy][1]; | |
| 684 | + s->cur_pic.motion_val[dir][xy + 1][0] = s->cur_pic.motion_val[dir][xy][0]; | |
| 685 | + s->cur_pic.motion_val[dir][xy + 1][1] = s->cur_pic.motion_val[dir][xy][1]; | |
| 686 | 686 | s->mv[dir][n + 1][0] = s->mv[dir][n][0]; |
| 687 | 687 | s->mv[dir][n + 1][1] = s->mv[dir][n][1]; |
| 688 | 688 | } |
| @@ -715,19 +715,19 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], · 26 unmodified lines | ||
| 715 | 715 | xy = s->block_index[0]; |
| 716 | 716 | |
| 717 | 717 | if (s->mb_intra) { |
| 718 | − s->current_picture.motion_val[0][xy][0] = | |
| 719 | − s->current_picture.motion_val[0][xy][1] = | |
| 720 | − s->current_picture.motion_val[1][xy][0] = | |
| 721 | − s->current_picture.motion_val[1][xy][1] = 0; | |
| 718 | + s->cur_pic.motion_val[0][xy][0] = | |
| 719 | + s->cur_pic.motion_val[0][xy][1] = | |
| 720 | + s->cur_pic.motion_val[1][xy][0] = | |
| 721 | + s->cur_pic.motion_val[1][xy][1] = 0; | |
| 722 | 722 | return; |
| 723 | 723 | } |
| 724 | − if (direct && s->next_picture_ptr->field_picture) | |
| 724 | + if (direct && s->next_pic_ptr->field_picture) | |
| 725 | 725 | av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n"); |
| 726 | 726 | |
| 727 | − s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample); | |
| 728 | − s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample); | |
| 729 | − s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample); | |
| 730 | − s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample); | |
| 727 | + s->mv[0][0][0] = scale_mv(s->next_pic.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample); | |
| 728 | + s->mv[0][0][1] = scale_mv(s->next_pic.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample); | |
| 729 | + s->mv[1][0][0] = scale_mv(s->next_pic.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample); | |
| 730 | + s->mv[1][0][1] = scale_mv(s->next_pic.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample); | |
| 731 | 731 | |
| 732 | 732 | /* Pullback predicted motion vectors as specified in 8.4.5.4 */ |
| 733 | 733 | s->mv[0][0][0] = av_clip(s->mv[0][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); |
| @@ -735,18 +735,18 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], · 1 unmodified line | ||
| 735 | 735 | s->mv[1][0][0] = av_clip(s->mv[1][0][0], -60 - (s->mb_x << 6), (s->mb_width << 6) - 4 - (s->mb_x << 6)); |
| 736 | 736 | s->mv[1][0][1] = av_clip(s->mv[1][0][1], -60 - (s->mb_y << 6), (s->mb_height << 6) - 4 - (s->mb_y << 6)); |
| 737 | 737 | if (direct) { |
| 738 | − s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0]; | |
| 739 | − s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1]; | |
| 740 | − s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0]; | |
| 741 | − s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1]; | |
| 738 | + s->cur_pic.motion_val[0][xy][0] = s->mv[0][0][0]; | |
| 739 | + s->cur_pic.motion_val[0][xy][1] = s->mv[0][0][1]; | |
| 740 | + s->cur_pic.motion_val[1][xy][0] = s->mv[1][0][0]; | |
| 741 | + s->cur_pic.motion_val[1][xy][1] = s->mv[1][0][1]; | |
| 742 | 742 | return; |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | if ((mvtype == BMV_TYPE_FORWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) { |
| 746 | − C = s->current_picture.motion_val[0][xy - 2]; | |
| 747 | − A = s->current_picture.motion_val[0][xy - wrap * 2]; | |
| 746 | + C = s->cur_pic.motion_val[0][xy - 2]; | |
| 747 | + A = s->cur_pic.motion_val[0][xy - wrap * 2]; | |
| 748 | 748 | off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; |
| 749 | − B = s->current_picture.motion_val[0][xy - wrap * 2 + off]; | |
| 749 | + B = s->cur_pic.motion_val[0][xy - wrap * 2 + off]; | |
| 750 | 750 | |
| 751 | 751 | if (!s->mb_x) C[0] = C[1] = 0; |
| 752 | 752 | if (!s->first_slice_line) { // predictor A is not out of bounds |
| @@ -812,10 +812,10 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], · 59 unmodified lines | ||
| 812 | 812 | s->mv[0][0][1] = ((py + dmv_y[0] + r_y) & ((r_y << 1) - 1)) - r_y; |
| 813 | 813 | } |
| 814 | 814 | if ((mvtype == BMV_TYPE_BACKWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) { |
| 815 | − C = s->current_picture.motion_val[1][xy - 2]; | |
| 816 | − A = s->current_picture.motion_val[1][xy - wrap * 2]; | |
| 815 | + C = s->cur_pic.motion_val[1][xy - 2]; | |
| 816 | + A = s->cur_pic.motion_val[1][xy - wrap * 2]; | |
| 817 | 817 | off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2; |
| 818 | − B = s->current_picture.motion_val[1][xy - wrap * 2 + off]; | |
| 818 | + B = s->cur_pic.motion_val[1][xy - wrap * 2 + off]; | |
| 819 | 819 | |
| 820 | 820 | if (!s->mb_x) |
| 821 | 821 | C[0] = C[1] = 0; |
| @@ -882,10 +882,10 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], · 60 unmodified lines | ||
| 882 | 882 | s->mv[1][0][0] = ((px + dmv_x[1] + r_x) & ((r_x << 1) - 1)) - r_x; |
| 883 | 883 | s->mv[1][0][1] = ((py + dmv_y[1] + r_y) & ((r_y << 1) - 1)) - r_y; |
| 884 | 884 | } |
| 885 | − s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0]; | |
| 886 | − s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1]; | |
| 887 | − s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0]; | |
| 888 | − s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1]; | |
| 885 | + s->cur_pic.motion_val[0][xy][0] = s->mv[0][0][0]; | |
| 886 | + s->cur_pic.motion_val[0][xy][1] = s->mv[0][0][1]; | |
| 887 | + s->cur_pic.motion_val[1][xy][0] = s->mv[1][0][0]; | |
| 888 | + s->cur_pic.motion_val[1][xy][1] = s->mv[1][0][1]; | |
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, |
| @@ -897,14 +897,14 @@ void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, · 5 unmodified lines | ||
| 897 | 897 | |
| 898 | 898 | if (v->bmvtype == BMV_TYPE_DIRECT) { |
| 899 | 899 | int total_opp, k, f; |
| 900 | − if (s->next_picture.mb_type[mb_pos + v->mb_off] != MB_TYPE_INTRA) { | |
| 901 | − s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 900 | + if (s->next_pic.mb_type[mb_pos + v->mb_off] != MB_TYPE_INTRA) { | |
| 901 | + s->mv[0][0][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 902 | 902 | v->bfraction, 0, s->quarter_sample); |
| 903 | − s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1], | |
| 903 | + s->mv[0][0][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][1], | |
| 904 | 904 | v->bfraction, 0, s->quarter_sample); |
| 905 | − s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 905 | + s->mv[1][0][0] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][0], | |
| 906 | 906 | v->bfraction, 1, s->quarter_sample); |
| 907 | − s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][s->block_index[0] + v->blocks_off][1], | |
| 907 | + s->mv[1][0][1] = scale_mv(s->next_pic.motion_val[1][s->block_index[0] + v->blocks_off][1], | |
| 908 | 908 | v->bfraction, 1, s->quarter_sample); |
| 909 | 909 | |
| 910 | 910 | total_opp = v->mv_f_next[0][s->block_index[0] + v->blocks_off] |
| @@ -919,10 +919,10 @@ void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, · 8 unmodified lines | ||
| 919 | 919 | } |
| 920 | 920 | v->ref_field_type[0] = v->ref_field_type[1] = v->cur_field_type ^ f; |
| 921 | 921 | for (k = 0; k < 4; k++) { |
| 922 | − s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][0] = s->mv[0][0][0]; | |
| 923 | − s->current_picture.motion_val[0][s->block_index[k] + v->blocks_off][1] = s->mv[0][0][1]; | |
| 924 | − s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][0] = s->mv[1][0][0]; | |
| 925 | − s->current_picture.motion_val[1][s->block_index[k] + v->blocks_off][1] = s->mv[1][0][1]; | |
| 922 | + s->cur_pic.motion_val[0][s->block_index[k] + v->blocks_off][0] = s->mv[0][0][0]; | |
| 923 | + s->cur_pic.motion_val[0][s->block_index[k] + v->blocks_off][1] = s->mv[0][0][1]; | |
| 924 | + s->cur_pic.motion_val[1][s->block_index[k] + v->blocks_off][0] = s->mv[1][0][0]; | |
| 925 | + s->cur_pic.motion_val[1][s->block_index[k] + v->blocks_off][1] = s->mv[1][0][1]; | |
| 926 | 926 | v->mv_f[0][s->block_index[k] + v->blocks_off] = f; |
| 927 | 927 | v->mv_f[1][s->block_index[k] + v->blocks_off] = f; |
| 928 | 928 | } |
| @@ -235,15 +235,15 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd) · 234 unmodified lines | ||
| 235 | 235 | v->sprite_output_frame->linesize[plane] * row; |
| 236 | 236 | |
| 237 | 237 | for (sprite = 0; sprite <= v->two_sprites; sprite++) { |
| 238 | − uint8_t *iplane = s->current_picture.f->data[plane]; | |
| 239 | − int iline = s->current_picture.f->linesize[plane]; | |
| 238 | + uint8_t *iplane = s->cur_pic.f->data[plane]; | |
| 239 | + int iline = s->cur_pic.f->linesize[plane]; | |
| 240 | 240 | int ycoord = yoff[sprite] + yadv[sprite] * row; |
| 241 | 241 | int yline = ycoord >> 16; |
| 242 | 242 | int next_line; |
| 243 | 243 | ysub[sprite] = ycoord & 0xFFFF; |
| 244 | 244 | if (sprite) { |
| 245 | − iplane = s->last_picture.f->data[plane]; | |
| 246 | − iline = s->last_picture.f->linesize[plane]; | |
| 245 | + iplane = s->last_pic.f->data[plane]; | |
| 246 | + iline = s->last_pic.f->linesize[plane]; | |
| 247 | 247 | } |
| 248 | 248 | next_line = FFMIN(yline + 1, (v->sprite_height >> !!plane) - 1) * iline; |
| 249 | 249 | if (!(xoff[sprite] & 0xFFFF) && xadv[sprite] == 1 << 16) { |
| @@ -317,12 +317,12 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb) · 67 unmodified lines | ||
| 317 | 317 | if (ret < 0) |
| 318 | 318 | return ret; |
| 319 | 319 | |
| 320 | − if (!s->current_picture.f || !s->current_picture.f->data[0]) { | |
| 320 | + if (!s->cur_pic.f || !s->cur_pic.f->data[0]) { | |
| 321 | 321 | av_log(avctx, AV_LOG_ERROR, "Got no sprites\n"); |
| 322 | 322 | return AVERROR_UNKNOWN; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | − if (v->two_sprites && (!s->last_picture_ptr || !s->last_picture.f->data[0])) { | |
| 325 | + if (v->two_sprites && (!s->last_pic_ptr || !s->last_pic.f->data[0])) { | |
| 326 | 326 | av_log(avctx, AV_LOG_WARNING, "Need two sprites, only got one\n"); |
| 327 | 327 | v->two_sprites = 0; |
| 328 | 328 | } |
| @@ -340,7 +340,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx) · 11 unmodified lines | ||
| 340 | 340 | { |
| 341 | 341 | VC1Context *v = avctx->priv_data; |
| 342 | 342 | MpegEncContext *s = &v->s; |
| 343 | − AVFrame *f = s->current_picture.f; | |
| 343 | + AVFrame *f = s->cur_pic.f; | |
| 344 | 344 | int plane, i; |
| 345 | 345 | |
| 346 | 346 | /* Windows Media Image codecs have a convergence interval of two keyframes. |
| @@ -837,10 +837,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 490 unmodified lines | ||
| 837 | 837 | /* no supplementary picture */ |
| 838 | 838 | if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) { |
| 839 | 839 | /* special case for last picture */ |
| 840 | − if (s->low_delay == 0 && s->next_picture_ptr) { | |
| 841 | − if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) | |
| 840 | + if (s->low_delay == 0 && s->next_pic_ptr) { | |
| 841 | + if ((ret = av_frame_ref(pict, s->next_pic_ptr->f)) < 0) | |
| 842 | 842 | return ret; |
| 843 | − s->next_picture_ptr = NULL; | |
| 843 | + s->next_pic_ptr = NULL; | |
| 844 | 844 | |
| 845 | 845 | *got_frame = 1; |
| 846 | 846 | } |
| @@ -1047,7 +1047,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 200 unmodified lines | ||
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | /* skip B-frames if we don't have reference frames */ |
| 1050 | − if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) { | |
| 1050 | + if (!s->last_pic_ptr && s->pict_type == AV_PICTURE_TYPE_B) { | |
| 1051 | 1051 | av_log(v->s.avctx, AV_LOG_DEBUG, "Skipping B frame without reference frames\n"); |
| 1052 | 1052 | goto end; |
| 1053 | 1053 | } |
| @@ -1061,19 +1061,19 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 7 unmodified lines | ||
| 1061 | 1061 | goto err; |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | − v->s.current_picture_ptr->field_picture = v->field_mode; | |
| 1065 | − v->s.current_picture_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (v->fcm != PROGRESSIVE); | |
| 1066 | − v->s.current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!v->tff; | |
| 1064 | + v->s.cur_pic_ptr->field_picture = v->field_mode; | |
| 1065 | + v->s.cur_pic_ptr->f->flags |= AV_FRAME_FLAG_INTERLACED * (v->fcm != PROGRESSIVE); | |
| 1066 | + v->s.cur_pic_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!v->tff; | |
| 1067 | 1067 | |
| 1068 | 1068 | // process pulldown flags |
| 1069 | − s->current_picture_ptr->f->repeat_pict = 0; | |
| 1069 | + s->cur_pic_ptr->f->repeat_pict = 0; | |
| 1070 | 1070 | // Pulldown flags are only valid when 'broadcast' has been set. |
| 1071 | 1071 | if (v->rff) { |
| 1072 | 1072 | // repeat field |
| 1073 | − s->current_picture_ptr->f->repeat_pict = 1; | |
| 1073 | + s->cur_pic_ptr->f->repeat_pict = 1; | |
| 1074 | 1074 | } else if (v->rptfrm) { |
| 1075 | 1075 | // repeat frames |
| 1076 | − s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2; | |
| 1076 | + s->cur_pic_ptr->f->repeat_pict = v->rptfrm * 2; | |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | if (avctx->hwaccel) { |
| @@ -1135,7 +1135,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 55 unmodified lines | ||
| 1135 | 1135 | ret = AVERROR_INVALIDDATA; |
| 1136 | 1136 | goto err; |
| 1137 | 1137 | } |
| 1138 | − v->s.current_picture_ptr->f->pict_type = v->s.pict_type; | |
| 1138 | + v->s.cur_pic_ptr->f->pict_type = v->s.pict_type; | |
| 1139 | 1139 | |
| 1140 | 1140 | ret = hwaccel->start_frame(avctx, buf_start_second_field, |
| 1141 | 1141 | (buf + buf_size) - buf_start_second_field); |
| @@ -1230,9 +1230,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 88 unmodified lines | ||
| 1230 | 1230 | |
| 1231 | 1231 | v->end_mb_x = s->mb_width; |
| 1232 | 1232 | if (v->field_mode) { |
| 1233 | − s->current_picture.f->linesize[0] <<= 1; | |
| 1234 | − s->current_picture.f->linesize[1] <<= 1; | |
| 1235 | − s->current_picture.f->linesize[2] <<= 1; | |
| 1233 | + s->cur_pic.f->linesize[0] <<= 1; | |
| 1234 | + s->cur_pic.f->linesize[1] <<= 1; | |
| 1235 | + s->cur_pic.f->linesize[2] <<= 1; | |
| 1236 | 1236 | s->linesize <<= 1; |
| 1237 | 1237 | s->uvlinesize <<= 1; |
| 1238 | 1238 | } |
| @@ -1307,9 +1307,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 68 unmodified lines | ||
| 1307 | 1307 | } |
| 1308 | 1308 | if (v->field_mode) { |
| 1309 | 1309 | v->second_field = 0; |
| 1310 | − s->current_picture.f->linesize[0] >>= 1; | |
| 1311 | − s->current_picture.f->linesize[1] >>= 1; | |
| 1312 | − s->current_picture.f->linesize[2] >>= 1; | |
| 1310 | + s->cur_pic.f->linesize[0] >>= 1; | |
| 1311 | + s->cur_pic.f->linesize[1] >>= 1; | |
| 1312 | + s->cur_pic.f->linesize[2] >>= 1; | |
| 1313 | 1313 | s->linesize >>= 1; |
| 1314 | 1314 | s->uvlinesize >>= 1; |
| 1315 | 1315 | if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) { |
| @@ -1353,16 +1353,16 @@ image: · 37 unmodified lines | ||
| 1353 | 1353 | *got_frame = 1; |
| 1354 | 1354 | } else { |
| 1355 | 1355 | if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { |
| 1356 | − if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) | |
| 1356 | + if ((ret = av_frame_ref(pict, s->cur_pic_ptr->f)) < 0) | |
| 1357 | 1357 | goto err; |
| 1358 | 1358 | if (!v->field_mode) |
| 1359 | − ff_print_debug_info(s, s->current_picture_ptr, pict); | |
| 1359 | + ff_print_debug_info(s, s->cur_pic_ptr, pict); | |
| 1360 | 1360 | *got_frame = 1; |
| 1361 | − } else if (s->last_picture_ptr) { | |
| 1362 | − if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) | |
| 1361 | + } else if (s->last_pic_ptr) { | |
| 1362 | + if ((ret = av_frame_ref(pict, s->last_pic_ptr->f)) < 0) | |
| 1363 | 1363 | goto err; |
| 1364 | 1364 | if (!v->field_mode) |
| 1365 | − ff_print_debug_info(s, s->last_picture_ptr, pict); | |
| 1365 | + ff_print_debug_info(s, s->last_pic_ptr, pict); | |
| 1366 | 1366 | *got_frame = 1; |
| 1367 | 1367 | } |
| 1368 | 1368 | } |
| @@ -370,7 +370,7 @@ int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, · 369 unmodified lines | ||
| 370 | 370 | int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx) |
| 371 | 371 | { |
| 372 | 372 | MpegEncContext *s = avctx->priv_data; |
| 373 | − Picture *pic = s->current_picture_ptr; | |
| 373 | + Picture *pic = s->cur_pic_ptr; | |
| 374 | 374 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 375 | 375 | int val; |
| 376 | 376 | |
| @@ -35,7 +35,7 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx, · 34 unmodified lines | ||
| 35 | 35 | const uint8_t *buffer, uint32_t size) |
| 36 | 36 | { |
| 37 | 37 | MpegEncContext * const s = avctx->priv_data; |
| 38 | − Picture *pic = s->current_picture_ptr; | |
| 38 | + Picture *pic = s->cur_pic_ptr; | |
| 39 | 39 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 40 | 40 | VdpPictureInfoMPEG1Or2 *info = &pic_ctx->info.mpeg; |
| 41 | 41 | VdpVideoSurface ref; |
| @@ -47,12 +47,12 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx, · 5 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | switch (s->pict_type) { |
| 49 | 49 | case AV_PICTURE_TYPE_B: |
| 50 | − ref = ff_vdpau_get_surface_id(s->next_picture.f); | |
| 50 | + ref = ff_vdpau_get_surface_id(s->next_pic.f); | |
| 51 | 51 | assert(ref != VDP_INVALID_HANDLE); |
| 52 | 52 | info->backward_reference = ref; |
| 53 | 53 | /* fall through to forward prediction */ |
| 54 | 54 | case AV_PICTURE_TYPE_P: |
| 55 | − ref = ff_vdpau_get_surface_id(s->last_picture.f); | |
| 55 | + ref = ff_vdpau_get_surface_id(s->last_pic.f); | |
| 56 | 56 | info->forward_reference = ref; |
| 57 | 57 | } |
| 58 | 58 | |
| @@ -87,7 +87,7 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx, · 28 unmodified lines | ||
| 87 | 87 | const uint8_t *buffer, uint32_t size) |
| 88 | 88 | { |
| 89 | 89 | MpegEncContext * const s = avctx->priv_data; |
| 90 | − Picture *pic = s->current_picture_ptr; | |
| 90 | + Picture *pic = s->cur_pic_ptr; | |
| 91 | 91 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 92 | 92 | int val; |
| 93 | 93 | |
| @@ -34,7 +34,7 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx, · 33 unmodified lines | ||
| 34 | 34 | { |
| 35 | 35 | Mpeg4DecContext *ctx = avctx->priv_data; |
| 36 | 36 | MpegEncContext * const s = &ctx->m; |
| 37 | − Picture *pic = s->current_picture_ptr; | |
| 37 | + Picture *pic = s->cur_pic_ptr; | |
| 38 | 38 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 39 | 39 | VdpPictureInfoMPEG4Part2 *info = &pic_ctx->info.mpeg4; |
| 40 | 40 | VdpVideoSurface ref; |
| @@ -47,13 +47,13 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx, · 6 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | switch (s->pict_type) { |
| 49 | 49 | case AV_PICTURE_TYPE_B: |
| 50 | − ref = ff_vdpau_get_surface_id(s->next_picture.f); | |
| 50 | + ref = ff_vdpau_get_surface_id(s->next_pic.f); | |
| 51 | 51 | assert(ref != VDP_INVALID_HANDLE); |
| 52 | 52 | info->backward_reference = ref; |
| 53 | 53 | info->vop_coding_type = 2; |
| 54 | 54 | /* fall-through */ |
| 55 | 55 | case AV_PICTURE_TYPE_P: |
| 56 | − ref = ff_vdpau_get_surface_id(s->last_picture.f); | |
| 56 | + ref = ff_vdpau_get_surface_id(s->last_pic.f); | |
| 57 | 57 | assert(ref != VDP_INVALID_HANDLE); |
| 58 | 58 | info->forward_reference = ref; |
| 59 | 59 | } |
| @@ -36,7 +36,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, · 35 unmodified lines | ||
| 36 | 36 | { |
| 37 | 37 | VC1Context * const v = avctx->priv_data; |
| 38 | 38 | MpegEncContext * const s = &v->s; |
| 39 | − Picture *pic = s->current_picture_ptr; | |
| 39 | + Picture *pic = s->cur_pic_ptr; | |
| 40 | 40 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 41 | 41 | VdpPictureInfoVC1 *info = &pic_ctx->info.vc1; |
| 42 | 42 | VdpVideoSurface ref; |
| @@ -47,15 +47,15 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, · 4 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | switch (s->pict_type) { |
| 49 | 49 | case AV_PICTURE_TYPE_B: |
| 50 | − if (s->next_picture_ptr) { | |
| 51 | − ref = ff_vdpau_get_surface_id(s->next_picture.f); | |
| 50 | + if (s->next_pic_ptr) { | |
| 51 | + ref = ff_vdpau_get_surface_id(s->next_pic.f); | |
| 52 | 52 | assert(ref != VDP_INVALID_HANDLE); |
| 53 | 53 | info->backward_reference = ref; |
| 54 | 54 | } |
| 55 | 55 | /* fall-through */ |
| 56 | 56 | case AV_PICTURE_TYPE_P: |
| 57 | − if (s->last_picture_ptr) { | |
| 58 | − ref = ff_vdpau_get_surface_id(s->last_picture.f); | |
| 57 | + if (s->last_pic_ptr) { | |
| 58 | + ref = ff_vdpau_get_surface_id(s->last_pic.f); | |
| 59 | 59 | assert(ref != VDP_INVALID_HANDLE); |
| 60 | 60 | info->forward_reference = ref; |
| 61 | 61 | } |
| @@ -104,7 +104,7 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx, · 42 unmodified lines | ||
| 104 | 104 | { |
| 105 | 105 | VC1Context * const v = avctx->priv_data; |
| 106 | 106 | MpegEncContext * const s = &v->s; |
| 107 | − Picture *pic = s->current_picture_ptr; | |
| 107 | + Picture *pic = s->cur_pic_ptr; | |
| 108 | 108 | struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; |
| 109 | 109 | int val; |
| 110 | 110 | |
| @@ -1108,7 +1108,7 @@ static int videotoolbox_mpeg_decode_slice(AVCodecContext *avctx, · 1107 unmodified lines | ||
| 1108 | 1108 | static int videotoolbox_mpeg_end_frame(AVCodecContext *avctx) |
| 1109 | 1109 | { |
| 1110 | 1110 | MpegEncContext *s = avctx->priv_data; |
| 1111 | − AVFrame *frame = s->current_picture_ptr->f; | |
| 1111 | + AVFrame *frame = s->cur_pic_ptr->f; | |
| 1112 | 1112 | |
| 1113 | 1113 | return ff_videotoolbox_common_end_frame(avctx, frame); |
| 1114 | 1114 | } |
| @@ -103,7 +103,7 @@ static int parse_mb_skip(WMV2DecContext *w) · 102 unmodified lines | ||
| 103 | 103 | int mb_x, mb_y; |
| 104 | 104 | int coded_mb_count = 0; |
| 105 | 105 | MpegEncContext *const s = &w->s; |
| 106 | − uint32_t *const mb_type = s->current_picture_ptr->mb_type; | |
| 106 | + uint32_t *const mb_type = s->cur_pic_ptr->mb_type; | |
| 107 | 107 | |
| 108 | 108 | w->skip_type = get_bits(&s->gb, 2); |
| 109 | 109 | switch (w->skip_type) { |
| @@ -238,8 +238,8 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) · 128 unmodified lines | ||
| 238 | 238 | |
| 239 | 239 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 240 | 240 | /* Is filling with zeroes really the right thing to do? */ |
| 241 | − memset(s->current_picture_ptr->mb_type, 0, | |
| 242 | − sizeof(*s->current_picture_ptr->mb_type) * | |
| 241 | + memset(s->cur_pic_ptr->mb_type, 0, | |
| 242 | + sizeof(*s->cur_pic_ptr->mb_type) * | |
| 243 | 243 | s->mb_height * s->mb_stride); |
| 244 | 244 | if (w->j_type_bit) |
| 245 | 245 | w->j_type = get_bits1(&s->gb); |
| @@ -331,7 +331,7 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) · 85 unmodified lines | ||
| 331 | 331 | s->esc3_run_length = 0; |
| 332 | 332 | |
| 333 | 333 | if (w->j_type) { |
| 334 | − ff_intrax8_decode_picture(&w->x8, &s->current_picture, | |
| 334 | + ff_intrax8_decode_picture(&w->x8, &s->cur_pic, | |
| 335 | 335 | &s->gb, &s->mb_x, &s->mb_y, |
| 336 | 336 | 2 * s->qscale, (s->qscale - 1) | 1, |
| 337 | 337 | s->loop_filter, s->low_delay); |
| @@ -366,11 +366,11 @@ static int16_t *wmv2_pred_motion(WMV2DecContext *w, int *px, int *py) · 28 unmodified lines | ||
| 366 | 366 | wrap = s->b8_stride; |
| 367 | 367 | xy = s->block_index[0]; |
| 368 | 368 | |
| 369 | − mot_val = s->current_picture.motion_val[0][xy]; | |
| 369 | + mot_val = s->cur_pic.motion_val[0][xy]; | |
| 370 | 370 | |
| 371 | − A = s->current_picture.motion_val[0][xy - 1]; | |
| 372 | − B = s->current_picture.motion_val[0][xy - wrap]; | |
| 373 | − C = s->current_picture.motion_val[0][xy + 2 - wrap]; | |
| 371 | + A = s->cur_pic.motion_val[0][xy - 1]; | |
| 372 | + B = s->cur_pic.motion_val[0][xy - wrap]; | |
| 373 | + C = s->cur_pic.motion_val[0][xy + 2 - wrap]; | |
| 374 | 374 | |
| 375 | 375 | if (s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag) |
| 376 | 376 | diff = FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1])); |
| @@ -452,7 +452,7 @@ static int wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) · 75 unmodified lines | ||
| 452 | 452 | return 0; |
| 453 | 453 | |
| 454 | 454 | if (s->pict_type == AV_PICTURE_TYPE_P) { |
| 455 | − if (IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])) { | |
| 455 | + if (IS_SKIP(s->cur_pic.mb_type[s->mb_y * s->mb_stride + s->mb_x])) { | |
| 456 | 456 | /* skip mb */ |
| 457 | 457 | s->mb_intra = 0; |
| 458 | 458 | for (i = 0; i < 6; i++) |