diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-12-17 21:36:05 +0100 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-12-18 19:36:58 +0100 |
commit | 73ad2c2fa725be51215e1c021c5335f8ce65af79 (patch) | |
tree | e7004c4cc1960f3aa8aa5df6ff8cc865e3c03df2 /libavcodec/h264_direct.c | |
parent | 523c7bd23c781aa0f3a85044896f5e18e8b52534 (diff) | |
download | ffmpeg-73ad2c2fa725be51215e1c021c5335f8ce65af79.tar.gz |
h264: increase dist_scale_factor for up to 32 references
Compute dist_scale_factor_field only for MBAFF since that is the only
case in which it is used.
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r-- | libavcodec/h264_direct.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index fc429aee80..a33efa5d6f 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -54,14 +54,17 @@ void ff_h264_direct_dist_scale_factor(H264Context * const h){ const int poc = h->s.current_picture_ptr->field_poc[ s->picture_structure == PICT_BOTTOM_FIELD ]; const int poc1 = h->ref_list[1][0].poc; int i, field; - for(field=0; field<2; field++){ - const int poc = h->s.current_picture_ptr->field_poc[field]; - const int poc1 = h->ref_list[1][0].field_poc[field]; - for(i=0; i < 2*h->ref_count[0]; i++) - h->dist_scale_factor_field[field][i^field] = get_scale_factor(h, poc, poc1, i+16); - } - for(i=0; i<h->ref_count[0]; i++){ + if (FRAME_MBAFF) + for (field = 0; field < 2; field++){ + const int poc = h->s.current_picture_ptr->field_poc[field]; + const int poc1 = h->ref_list[1][0].field_poc[field]; + for (i = 0; i < 2 * h->ref_count[0]; i++) + h->dist_scale_factor_field[field][i^field] = + get_scale_factor(h, poc, poc1, i+16); + } + + for (i = 0; i < h->ref_count[0]; i++){ h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i); } } |