comparison rv34.c @ 6155:a425bdc70ac5 libavcodec

Save coded block patterns for future loop filtering.
author kostya
date Fri, 18 Jan 2008 07:04:11 +0000
parents bc59962f70b9
children b5702c981fe2
comparison
equal deleted inserted replaced
6154:10e8a0596311 6155:a425bdc70ac5
1010 if(s->mb_x && dist > s->mb_width) 1010 if(s->mb_x && dist > s->mb_width)
1011 r->avail_cache[0] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1]; 1011 r->avail_cache[0] = s->current_picture_ptr->mb_type[mb_pos - s->mb_stride - 1];
1012 1012
1013 s->qscale = r->si.quant; 1013 s->qscale = r->si.quant;
1014 cbp = cbp2 = rv34_decode_mb_header(r, intra_types); 1014 cbp = cbp2 = rv34_decode_mb_header(r, intra_types);
1015 r->cbp_luma [s->mb_x + s->mb_y * s->mb_stride] = cbp;
1016 r->cbp_chroma[s->mb_x + s->mb_y * s->mb_stride] = cbp >> 16;
1015 1017
1016 if(cbp == -1) 1018 if(cbp == -1)
1017 return -1; 1019 return -1;
1018 1020
1019 luma_dc_quant = r->si.type ? r->luma_dc_quant_p[s->qscale] : r->luma_dc_quant_i[s->qscale]; 1021 luma_dc_quant = r->si.type ? r->luma_dc_quant_p[s->qscale] : r->luma_dc_quant_i[s->qscale];
1099 if(MPV_common_init(s) < 0) 1101 if(MPV_common_init(s) < 0)
1100 return -1; 1102 return -1;
1101 r->intra_types_hist = av_realloc(r->intra_types_hist, s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist)); 1103 r->intra_types_hist = av_realloc(r->intra_types_hist, s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist));
1102 r->intra_types = r->intra_types_hist + s->b4_stride * 4; 1104 r->intra_types = r->intra_types_hist + s->b4_stride * 4;
1103 r->mb_type = av_realloc(r->mb_type, r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type)); 1105 r->mb_type = av_realloc(r->mb_type, r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
1106 r->cbp_luma = av_realloc(r->cbp_luma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
1107 r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
1104 } 1108 }
1105 s->pict_type = r->si.type ? r->si.type : I_TYPE; 1109 s->pict_type = r->si.type ? r->si.type : I_TYPE;
1106 if(MPV_frame_start(s, s->avctx) < 0) 1110 if(MPV_frame_start(s, s->avctx) < 0)
1107 return -1; 1111 return -1;
1108 ff_er_frame_start(s); 1112 ff_er_frame_start(s);
1185 1189
1186 r->intra_types_hist = av_malloc(s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist)); 1190 r->intra_types_hist = av_malloc(s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist));
1187 r->intra_types = r->intra_types_hist + s->b4_stride * 4; 1191 r->intra_types = r->intra_types_hist + s->b4_stride * 4;
1188 1192
1189 r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type)); 1193 r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
1194
1195 r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
1196 r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
1190 1197
1191 if(!intra_vlcs[0].cbppattern[0].bits) 1198 if(!intra_vlcs[0].cbppattern[0].bits)
1192 rv34_init_tables(); 1199 rv34_init_tables();
1193 1200
1194 return 0; 1201 return 0;