diff options
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r-- | libavcodec/h264_direct.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index 0cf0d46022..4230a1387a 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -2,20 +2,20 @@ * H.26L/H.264/AVC/JVT/14496-10/... direct mb/block decoding * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -49,7 +49,9 @@ static int get_scale_factor(H264Context *const h, int poc, int poc1, int i) void ff_h264_direct_dist_scale_factor(H264Context *const h) { - const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD]; + const int poc = h->picture_structure == PICT_FRAME ? + h->cur_pic_ptr->poc : + h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD]; const int poc1 = h->ref_list[1][0].poc; int i, field; @@ -228,6 +230,7 @@ static void pred_spatial_direct_motion(H264Context *const h, int *mb_type) else mv[list] = AV_RN32A(C); } + av_assert2(ref[list] < (h->ref_count[list] << !!FRAME_MBAFF(h))); } else { int mask = ~(MB_TYPE_L0 << (2 * list)); mv[list] = 0; @@ -313,8 +316,8 @@ single_col: await_reference_mb_row(h, &h->ref_list[1][0], mb_y); - l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy[mb_xy]]; - l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy[mb_xy]]; + l1mv0 = (void*)&h->ref_list[1][0].motion_val[0][h->mb2b_xy[mb_xy]]; + l1mv1 = (void*)&h->ref_list[1][0].motion_val[1][h->mb2b_xy[mb_xy]]; l1ref0 = &h->ref_list[1][0].ref_index[0][4 * mb_xy]; l1ref1 = &h->ref_list[1][0].ref_index[1][4 * mb_xy]; if (!b8_stride) { @@ -536,8 +539,8 @@ single_col: await_reference_mb_row(h, &h->ref_list[1][0], mb_y); - l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy[mb_xy]]; - l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy[mb_xy]]; + l1mv0 = (void*)&h->ref_list[1][0].motion_val[0][h->mb2b_xy[mb_xy]]; + l1mv1 = (void*)&h->ref_list[1][0].motion_val[1][h->mb2b_xy[mb_xy]]; l1ref0 = &h->ref_list[1][0].ref_index[0][4 * mb_xy]; l1ref1 = &h->ref_list[1][0].ref_index[1][4 * mb_xy]; if (!b8_stride) { |