Lines Matching refs:mb
121 mb_info *mb; // MB RD state
209 if (!(s->mb = av_malloc_array(mb_count, sizeof(mb_info))))
267 mb_info *mb;
280 mb = &s->mb[x];
281 ret += FF_LAMBDA_SCALE * mb->v1_error;
284 mb->best_encoding = ENC_V1;
295 mb = &s->mb[x];
296 if (mb->best_encoding == ENC_V1)
297 score1 = s->lambda * 9 + FF_LAMBDA_SCALE * (mberr = mb->v1_error);
299 score1 = s->lambda * 33 + FF_LAMBDA_SCALE * (mberr = mb->v4_error);
304 mb = &s->mb[x];
305 score1 = s->lambda * 9 + FF_LAMBDA_SCALE * mb->v1_error;
306 score2 = s->lambda * 33 + FF_LAMBDA_SCALE * mb->v4_error;
310 mb->best_encoding = ENC_V1;
313 mb->best_encoding = ENC_V4;
324 mb = &s->mb[x];
327 score1 = s->lambda * 1 + FF_LAMBDA_SCALE * mb->skip_error;
328 if (mb->best_encoding == ENC_SKIP) {
330 } else if (mb->best_encoding == ENC_V1) {
331 if ((score2 = s->lambda * 10 + FF_LAMBDA_SCALE * mb->v1_error) >= score1) {
332 mb->best_encoding = ENC_SKIP;
339 if ((score3 = s->lambda * 34 + FF_LAMBDA_SCALE * mb->v4_error) >= score1) {
340 mb->best_encoding = ENC_SKIP;
352 mb = &s->mb[x];
353 score1 = s->lambda * 1 + FF_LAMBDA_SCALE * mb->skip_error;
354 score2 = s->lambda * 10 + FF_LAMBDA_SCALE * mb->v1_error;
355 score3 = s->lambda * 34 + FF_LAMBDA_SCALE * mb->v4_error;
359 mb->best_encoding = ENC_SKIP;
362 mb->best_encoding = ENC_V1;
365 mb->best_encoding = ENC_V4;
447 // decodes the V1 vector in mb into the 4x4 MB pointed to by data
486 // decodes the V4 vectors in mb into the 4x4 MB pointed to by data
535 mb_info *mb;
552 mb = &s->mb[z];
557 if (info->mode == MODE_MC && mb->best_encoding == ENC_SKIP) {
562 } else if (info->mode == MODE_V1_ONLY || mb->best_encoding == ENC_V1)
564 mb->v1_vector, info);
567 mb->v4_vector, info);
575 buf[ret++] = s->mb[x].v1_vector;
586 if (s->mb[y].best_encoding == ENC_V4)
593 mb = &s->mb[y];
595 if (mb->best_encoding == ENC_V1)
596 buf[ret++] = mb->v1_vector;
599 buf[ret++] = mb->v4_vector[z];
613 mb = &s->mb[x];
614 flags |= (uint32_t)(mb->best_encoding != ENC_SKIP) << (31 - bits++);
618 if (mb->best_encoding != ENC_SKIP) {
620 flags |= (uint32_t)(mb->best_encoding == ENC_V4) << (31 - bits++);
630 if (mb->best_encoding == ENC_SKIP || needs_extra_bit) {
639 flags = (uint32_t)(mb->best_encoding == ENC_V4) << 31;
643 if (mb->best_encoding == ENC_V1)
644 temp[temp_size++] = mb->v1_vector;
645 else if (mb->best_encoding == ENC_V4)
647 temp[temp_size++] = mb->v4_vector[z];
718 if (s->mb[mbn].best_encoding != encoding)
780 mb_info *mb = &s->mb[j];
782 if (CERTAIN(encoding) && mb->best_encoding != encoding)
789 mb->v1_vector = s->codebook_closest[i];
792 decode_v1_vector(s, vq_data, vq_linesize, mb->v1_vector, info);
794 mb->v1_error = compute_mb_distortion(s, sub_data, sub_linesize,
798 mb->v4_vector[k] = s->codebook_closest[i + k];
801 decode_v4_vector(s, vq_data, vq_linesize, mb->v4_vector, info);
803 mb->v4_error = compute_mb_distortion(s, sub_data, sub_linesize,
830 s->mb[i].skip_error =
1209 av_freep(&s->mb);