comparison rv34.c @ 8037:b6d93bef844a libavcodec

RV3 and RV4 decoders set some deblocking coefs for each macroblock, so store them in the context and register a function to calculate them.
author kostya
date Mon, 20 Oct 2008 05:58:05 +0000
parents 9b98b2261938
children efc935702bce
comparison
equal deleted inserted replaced
8036:9b98b2261938 8037:b6d93bef844a
1037 1037
1038 s->qscale = r->si.quant; 1038 s->qscale = r->si.quant;
1039 cbp = cbp2 = rv34_decode_mb_header(r, intra_types); 1039 cbp = cbp2 = rv34_decode_mb_header(r, intra_types);
1040 r->cbp_luma [s->mb_x + s->mb_y * s->mb_stride] = cbp; 1040 r->cbp_luma [s->mb_x + s->mb_y * s->mb_stride] = cbp;
1041 r->cbp_chroma[s->mb_x + s->mb_y * s->mb_stride] = cbp >> 16; 1041 r->cbp_chroma[s->mb_x + s->mb_y * s->mb_stride] = cbp >> 16;
1042 if(r->set_deblock_coef)
1043 r->deblock_coefs[s->mb_x + s->mb_y * s->mb_stride] = r->set_deblock_coef(r);
1042 s->current_picture.qscale_table[s->mb_x + s->mb_y * s->mb_stride] = s->qscale; 1044 s->current_picture.qscale_table[s->mb_x + s->mb_y * s->mb_stride] = s->qscale;
1043 1045
1044 if(cbp == -1) 1046 if(cbp == -1)
1045 return -1; 1047 return -1;
1046 1048
1130 r->intra_types_hist = av_realloc(r->intra_types_hist, s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist)); 1132 r->intra_types_hist = av_realloc(r->intra_types_hist, s->b4_stride * 4 * 2 * sizeof(*r->intra_types_hist));
1131 r->intra_types = r->intra_types_hist + s->b4_stride * 4; 1133 r->intra_types = r->intra_types_hist + s->b4_stride * 4;
1132 r->mb_type = av_realloc(r->mb_type, r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type)); 1134 r->mb_type = av_realloc(r->mb_type, r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
1133 r->cbp_luma = av_realloc(r->cbp_luma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma)); 1135 r->cbp_luma = av_realloc(r->cbp_luma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
1134 r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma)); 1136 r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
1137 r->deblock_coefs = av_realloc(r->deblock_coefs, r->s.mb_stride * r->s.mb_height * sizeof(*r->deblock_coefs));
1135 } 1138 }
1136 s->pict_type = r->si.type ? r->si.type : FF_I_TYPE; 1139 s->pict_type = r->si.type ? r->si.type : FF_I_TYPE;
1137 if(MPV_frame_start(s, s->avctx) < 0) 1140 if(MPV_frame_start(s, s->avctx) < 0)
1138 return -1; 1141 return -1;
1139 ff_er_frame_start(s); 1142 ff_er_frame_start(s);
1224 1227
1225 r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type)); 1228 r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(*r->mb_type));
1226 1229
1227 r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma)); 1230 r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_luma));
1228 r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma)); 1231 r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
1232 r->deblock_coefs = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->deblock_coefs));
1229 1233
1230 if(!intra_vlcs[0].cbppattern[0].bits) 1234 if(!intra_vlcs[0].cbppattern[0].bits)
1231 rv34_init_tables(); 1235 rv34_init_tables();
1232 1236
1233 return 0; 1237 return 0;