diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-21 21:34:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:38:30 +0100 |
commit | 759001c534287a96dc96d1e274665feb7059145d (patch) | |
tree | 6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/h264_mvpred.h | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) | |
download | ffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/h264_mvpred.h')
-rw-r--r-- | libavcodec/h264_mvpred.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h index b49ff31c15..a61ad20f66 100644 --- a/libavcodec/h264_mvpred.h +++ b/libavcodec/h264_mvpred.h @@ -48,15 +48,15 @@ static av_always_inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, const int mb_type = mb_types[xy + (y4 >> 2) * h->mb_stride]; \ if (!USES_LIST(mb_type, list)) \ return LIST_NOT_USED; \ - mv = h->cur_pic_ptr->f.motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \ + mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \ h->mv_cache[list][scan8[0] - 2][0] = mv[0]; \ h->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP; \ - return h->cur_pic_ptr->f.ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP; + return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP; if (topright_ref == PART_NOT_AVAILABLE && i >= scan8[0] + 8 && (i & 7) == 4 && h->ref_cache[list][scan8[0] - 1] != PART_NOT_AVAILABLE) { - const uint32_t *mb_types = h->cur_pic_ptr->f.mb_type; + const uint32_t *mb_types = h->cur_pic_ptr->mb_type; const int16_t *mv; AV_ZERO32(h->mv_cache[list][scan8[0] - 2]); *C = h->mv_cache[list][scan8[0] - 2]; @@ -253,8 +253,8 @@ static av_always_inline void pred_pskip_motion(H264Context *const h) { DECLARE_ALIGNED(4, static const int16_t, zeromv)[2] = { 0 }; DECLARE_ALIGNED(4, int16_t, mvbuf)[3][2]; - int8_t *ref = h->cur_pic.f.ref_index[0]; - int16_t(*mv)[2] = h->cur_pic.f.motion_val[0]; + int8_t *ref = h->cur_pic.ref_index[0]; + int16_t(*mv)[2] = h->cur_pic.motion_val[0]; int top_ref, left_ref, diagonal_ref, match_count, mx, my; const int16_t *A, *B, *C; int b_stride = h->b_stride; @@ -370,7 +370,7 @@ static void fill_decode_neighbors(H264Context *h, int mb_type) left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1; h->left_block = left_block_options[0]; if (FRAME_MBAFF) { - const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.f.mb_type[mb_xy - 1]); + const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]); const int curr_mb_field_flag = IS_INTERLACED(mb_type); if (h->mb_y & 1) { if (left_mb_field_flag != curr_mb_field_flag) { @@ -388,9 +388,9 @@ static void fill_decode_neighbors(H264Context *h, int mb_type) } } else { if (curr_mb_field_flag) { - topleft_xy += h->mb_stride & (((h->cur_pic.f.mb_type[top_xy - 1] >> 7) & 1) - 1); - topright_xy += h->mb_stride & (((h->cur_pic.f.mb_type[top_xy + 1] >> 7) & 1) - 1); - top_xy += h->mb_stride & (((h->cur_pic.f.mb_type[top_xy] >> 7) & 1) - 1); + topleft_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy - 1] >> 7) & 1) - 1); + topright_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy + 1] >> 7) & 1) - 1); + top_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy] >> 7) & 1) - 1); } if (left_mb_field_flag != curr_mb_field_flag) { if (curr_mb_field_flag) { @@ -410,11 +410,11 @@ static void fill_decode_neighbors(H264Context *h, int mb_type) h->left_mb_xy[LBOT] = left_xy[LBOT]; //FIXME do we need all in the context? - h->topleft_type = h->cur_pic.f.mb_type[topleft_xy]; - h->top_type = h->cur_pic.f.mb_type[top_xy]; - h->topright_type = h->cur_pic.f.mb_type[topright_xy]; - h->left_type[LTOP] = h->cur_pic.f.mb_type[left_xy[LTOP]]; - h->left_type[LBOT] = h->cur_pic.f.mb_type[left_xy[LBOT]]; + h->topleft_type = h->cur_pic.mb_type[topleft_xy]; + h->top_type = h->cur_pic.mb_type[top_xy]; + h->topright_type = h->cur_pic.mb_type[topright_xy]; + h->left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]]; + h->left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]]; if (FMO) { if (h->slice_table[topleft_xy] != h->slice_num) @@ -480,7 +480,7 @@ static void fill_decode_caches(H264Context *h, int mb_type) h->left_samples_available &= 0xFF5F; } } else { - int left_typei = h->cur_pic.f.mb_type[left_xy[LTOP] + h->mb_stride]; + int left_typei = h->cur_pic.mb_type[left_xy[LTOP] + h->mb_stride]; assert(left_xy[LTOP] == left_xy[LBOT]); if (!((left_typei & type_mask) && (left_type[LTOP] & type_mask))) { @@ -602,9 +602,9 @@ static void fill_decode_caches(H264Context *h, int mb_type) int b_stride = h->b_stride; for (list = 0; list < h->list_count; list++) { int8_t *ref_cache = &h->ref_cache[list][scan8[0]]; - int8_t *ref = h->cur_pic.f.ref_index[list]; + int8_t *ref = h->cur_pic.ref_index[list]; int16_t(*mv_cache)[2] = &h->mv_cache[list][scan8[0]]; - int16_t(*mv)[2] = h->cur_pic.f.motion_val[list]; + int16_t(*mv)[2] = h->cur_pic.motion_val[list]; if (!USES_LIST(mb_type, list)) continue; assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred)); @@ -821,8 +821,8 @@ static void av_unused decode_mb_skip(H264Context *h) } write_back_motion(h, mb_type); - h->cur_pic.f.mb_type[mb_xy] = mb_type; - h->cur_pic.f.qscale_table[mb_xy] = h->qscale; + h->cur_pic.mb_type[mb_xy] = mb_type; + h->cur_pic.qscale_table[mb_xy] = h->qscale; h->slice_table[mb_xy] = h->slice_num; h->prev_mb_skipped = 1; } |