aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-19 15:07:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-19 15:07:12 +0200
commitada49f936eaafe12365c7b962355d6dcfbfc4029 (patch)
tree156ef379f06014ba97a73c7002b61b76c0a073a1 /libavcodec
parentba57ef29723e11e94f2d5a07d4f384e636316c16 (diff)
parent87cf70eb237e7586cc7399627dafa1b980ec0b7d (diff)
downloadffmpeg-ada49f936eaafe12365c7b962355d6dcfbfc4029.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: h264: correct implicit weight table computation for long ref pics h264: correct the check for invalid long term frame index in MMCO decode Conflicts: libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 29426f74b6..d644730784 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2204,17 +2204,17 @@ static void implicit_weight_table(H264Context *h, int field){
for(ref0=ref_start; ref0 < ref_count0; ref0++){
int poc0 = h->ref_list[0][ref0].poc;
for(ref1=ref_start; ref1 < ref_count1; ref1++){
- int w= 32;
- if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref){
- int poc1 = h->ref_list[1][ref1].poc;
- int td = av_clip(poc1 - poc0, -128, 127);
- if(td){
- int tb = av_clip(cur_poc - poc0, -128, 127);
- int tx = (16384 + (FFABS(td) >> 1)) / td;
- int dist_scale_factor = (tb*tx + 32) >> 8;
- if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
- w = 64 - dist_scale_factor;
- }
+ int w = 32;
+ if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
+ int poc1 = h->ref_list[1][ref1].poc;
+ int td = av_clip(poc1 - poc0, -128, 127);
+ if(td){
+ int tb = av_clip(cur_poc - poc0, -128, 127);
+ int tx = (16384 + (FFABS(td) >> 1)) / td;
+ int dist_scale_factor = (tb*tx + 32) >> 8;
+ if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
+ w = 64 - dist_scale_factor;
+ }
}
if(field<0){
h->implicit_weight[ref0][ref1][0]=