comparison h264.c @ 8956:de631175196e libavcodec

Move initialization of {luma,chroma}_weight_flag[] up, to make sure they are always initialized. Patch by Gwenole Beauchesne g${name} splitted-desktop com
author benoit
date Tue, 17 Feb 2009 13:41:27 +0000
parents e03f0d4f9e3d
children a5dce344904a
comparison
equal deleted inserted replaced
8955:e03f0d4f9e3d 8956:de631175196e
3044 static void implicit_weight_table(H264Context *h){ 3044 static void implicit_weight_table(H264Context *h){
3045 MpegEncContext * const s = &h->s; 3045 MpegEncContext * const s = &h->s;
3046 int ref0, ref1, i; 3046 int ref0, ref1, i;
3047 int cur_poc = s->current_picture_ptr->poc; 3047 int cur_poc = s->current_picture_ptr->poc;
3048 3048
3049 for (i = 0; i < 2; i++) {
3050 h->luma_weight_flag[i] = 0;
3051 h->chroma_weight_flag[i] = 0;
3052 }
3053
3049 if( h->ref_count[0] == 1 && h->ref_count[1] == 1 3054 if( h->ref_count[0] == 1 && h->ref_count[1] == 1
3050 && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){ 3055 && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){
3051 h->use_weight= 0; 3056 h->use_weight= 0;
3052 h->use_weight_chroma= 0; 3057 h->use_weight_chroma= 0;
3053 return; 3058 return;
3055 3060
3056 h->use_weight= 2; 3061 h->use_weight= 2;
3057 h->use_weight_chroma= 2; 3062 h->use_weight_chroma= 2;
3058 h->luma_log2_weight_denom= 5; 3063 h->luma_log2_weight_denom= 5;
3059 h->chroma_log2_weight_denom= 5; 3064 h->chroma_log2_weight_denom= 5;
3060 for (i = 0; i < 2; i++) {
3061 h->luma_weight_flag[i] = 0;
3062 h->chroma_weight_flag[i] = 0;
3063 }
3064 3065
3065 for(ref0=0; ref0 < h->ref_count[0]; ref0++){ 3066 for(ref0=0; ref0 < h->ref_count[0]; ref0++){
3066 int poc0 = h->ref_list[0][ref0].poc; 3067 int poc0 = h->ref_list[0][ref0].poc;
3067 for(ref1=0; ref1 < h->ref_count[1]; ref1++){ 3068 for(ref1=0; ref1 < h->ref_count[1]; ref1++){
3068 int poc1 = h->ref_list[1][ref1].poc; 3069 int poc1 = h->ref_list[1][ref1].poc;