comparison vc1.c @ 3375:a1c2e1603be9 libavcodec

Use MpegEncContext->mbskip_table instead of custom bitplane.
author kostya
date Sat, 01 Jul 2006 03:17:54 +0000
parents a922021d6455
children 9bf829b51da0
comparison
equal deleted inserted replaced
3374:e9614cf8ac92 3375:a1c2e1603be9
309 uint8_t pquantizer; ///< Uniform (over sequence) quantizer in use 309 uint8_t pquantizer; ///< Uniform (over sequence) quantizer in use
310 uint8_t *previous_line_cbpcy; ///< To use for predicted CBPCY 310 uint8_t *previous_line_cbpcy; ///< To use for predicted CBPCY
311 VLC *cbpcy_vlc; ///< CBPCY VLC table 311 VLC *cbpcy_vlc; ///< CBPCY VLC table
312 int tt_index; ///< Index for Transform Type tables 312 int tt_index; ///< Index for Transform Type tables
313 uint8_t* mv_type_mb_plane; ///< bitplane for mv_type == (4MV) 313 uint8_t* mv_type_mb_plane; ///< bitplane for mv_type == (4MV)
314 uint8_t* skip_mb_plane; ///< bitplane for skipped MBs
315 // BitPlane direct_mb_plane; ///< bitplane for "direct" MBs 314 // BitPlane direct_mb_plane; ///< bitplane for "direct" MBs
316 int mv_type_is_raw; ///< mv type mb plane is not coded 315 int mv_type_is_raw; ///< mv type mb plane is not coded
317 int skip_is_raw; ///< skip mb plane is not coded 316 int skip_is_raw; ///< skip mb plane is not coded
318 317
319 /** Frame decoding info for S/M profiles only */ 318 /** Frame decoding info for S/M profiles only */
1205 "Imode: %i, Invert: %i\n", status>>1, status&1); 1204 "Imode: %i, Invert: %i\n", status>>1, status&1);
1206 } else { 1205 } else {
1207 v->mv_type_is_raw = 0; 1206 v->mv_type_is_raw = 0;
1208 memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height); 1207 memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height);
1209 } 1208 }
1210 status = bitplane_decoding(v->skip_mb_plane, &v->skip_is_raw, v); 1209 status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
1211 if (status < 0) return -1; 1210 if (status < 0) return -1;
1212 av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: " 1211 av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
1213 "Imode: %i, Invert: %i\n", status>>1, status&1); 1212 "Imode: %i, Invert: %i\n", status>>1, status&1);
1214 1213
1215 /* Hopefully this is correct for P frames */ 1214 /* Hopefully this is correct for P frames */
2156 else 2155 else
2157 fourmv = v->mv_type_mb_plane[mb_pos]; 2156 fourmv = v->mv_type_mb_plane[mb_pos];
2158 if (v->skip_is_raw) 2157 if (v->skip_is_raw)
2159 skipped = get_bits1(gb); 2158 skipped = get_bits1(gb);
2160 else 2159 else
2161 skipped = v->skip_mb_plane[mb_pos]; 2160 skipped = v->s.mbskip_table[mb_pos];
2162 2161
2163 if (!fourmv) /* 1MV mode */ 2162 if (!fourmv) /* 1MV mode */
2164 { 2163 {
2165 if (!skipped) 2164 if (!skipped)
2166 { 2165 {
2517 s->mb_width = (avctx->coded_width+15)>>4; 2516 s->mb_width = (avctx->coded_width+15)>>4;
2518 s->mb_height = (avctx->coded_height+15)>>4; 2517 s->mb_height = (avctx->coded_height+15)>>4;
2519 2518
2520 /* Allocate mb bitplanes */ 2519 /* Allocate mb bitplanes */
2521 v->mv_type_mb_plane = av_malloc(s->mb_stride * s->mb_height); 2520 v->mv_type_mb_plane = av_malloc(s->mb_stride * s->mb_height);
2522 v->skip_mb_plane = av_malloc(s->mb_stride * s->mb_height);
2523 2521
2524 /* For predictors */ 2522 /* For predictors */
2525 v->previous_line_cbpcy = (uint8_t *)av_malloc(s->mb_stride*4); 2523 v->previous_line_cbpcy = (uint8_t *)av_malloc(s->mb_stride*4);
2526 if (!v->previous_line_cbpcy) return -1; 2524 if (!v->previous_line_cbpcy) return -1;
2527 2525
2644 2642
2645 av_freep(&v->hrd_rate); 2643 av_freep(&v->hrd_rate);
2646 av_freep(&v->hrd_buffer); 2644 av_freep(&v->hrd_buffer);
2647 MPV_common_end(&v->s); 2645 MPV_common_end(&v->s);
2648 av_freep(&v->mv_type_mb_plane); 2646 av_freep(&v->mv_type_mb_plane);
2649 av_freep(&v->skip_mb_plane);
2650 return 0; 2647 return 0;
2651 } 2648 }
2652 2649
2653 2650
2654 AVCodec vc1_decoder = { 2651 AVCodec vc1_decoder = {