comparison vp8.c @ 12224:5b7d690b761b libavcodec

VP8: Don't store segment in macroblock struct anymore. Not necessary with the previous patch.
author darkshikari
date Thu, 22 Jul 2010 11:55:55 +0000
parents 93e27a5401de
children c3e11b3108d7
comparison
equal deleted inserted replaced
12223:93e27a5401de 12224:5b7d690b761b
33 uint8_t inner_limit; 33 uint8_t inner_limit;
34 uint8_t inner_filter; 34 uint8_t inner_filter;
35 } VP8FilterStrength; 35 } VP8FilterStrength;
36 36
37 typedef struct { 37 typedef struct {
38 uint8_t segment;
39 uint8_t skip; 38 uint8_t skip;
40 // todo: make it possible to check for at least (i4x4 or split_mv) 39 // todo: make it possible to check for at least (i4x4 or split_mv)
41 // in one op. are others needed? 40 // in one op. are others needed?
42 uint8_t mode; 41 uint8_t mode;
43 uint8_t ref_frame; 42 uint8_t ref_frame;
118 DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4]; 117 DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4];
119 DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16]; 118 DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16];
120 uint8_t intra4x4_pred_mode_mb[16]; 119 uint8_t intra4x4_pred_mode_mb[16];
121 120
122 int chroma_pred_mode; ///< 8x8c pred mode of the current macroblock 121 int chroma_pred_mode; ///< 8x8c pred mode of the current macroblock
122 int segment; ///< segment of the current macroblock
123 123
124 int mbskip_enabled; 124 int mbskip_enabled;
125 int sign_bias[4]; ///< one state [0, 1] per ref frame type 125 int sign_bias[4]; ///< one state [0, 1] per ref frame type
126 126
127 /** 127 /**
706 { 706 {
707 VP56RangeCoder *c = &s->c; 707 VP56RangeCoder *c = &s->c;
708 708
709 if (s->segmentation.update_map) 709 if (s->segmentation.update_map)
710 *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid); 710 *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid);
711 mb->segment = *segment; 711 s->segment = *segment;
712 712
713 mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0; 713 mb->skip = s->mbskip_enabled ? vp56_rac_get_prob(c, s->prob->mbskip) : 0;
714 714
715 if (s->keyframe) { 715 if (s->keyframe) {
716 mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, vp8_pred16x16_prob_intra); 716 mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_intra, vp8_pred16x16_prob_intra);
828 uint8_t t_nnz[9], uint8_t l_nnz[9]) 828 uint8_t t_nnz[9], uint8_t l_nnz[9])
829 { 829 {
830 LOCAL_ALIGNED_16(DCTELEM, dc,[16]); 830 LOCAL_ALIGNED_16(DCTELEM, dc,[16]);
831 int i, x, y, luma_start = 0, luma_ctx = 3; 831 int i, x, y, luma_start = 0, luma_ctx = 3;
832 int nnz_pred, nnz, nnz_total = 0; 832 int nnz_pred, nnz, nnz_total = 0;
833 int segment = s->segmentation.enabled ? mb->segment : 0; 833 int segment = s->segment;
834 834
835 s->dsp.clear_blocks((DCTELEM *)s->block); 835 s->dsp.clear_blocks((DCTELEM *)s->block);
836 836
837 if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) { 837 if (mb->mode != MODE_I4x4 && mb->mode != VP8_MVMODE_SPLIT) {
838 AV_ZERO128(dc); 838 AV_ZERO128(dc);
1227 static void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f ) 1227 static void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f )
1228 { 1228 {
1229 int interior_limit, filter_level; 1229 int interior_limit, filter_level;
1230 1230
1231 if (s->segmentation.enabled) { 1231 if (s->segmentation.enabled) {
1232 filter_level = s->segmentation.filter_level[mb->segment]; 1232 filter_level = s->segmentation.filter_level[s->segment];
1233 if (!s->segmentation.absolute_vals) 1233 if (!s->segmentation.absolute_vals)
1234 filter_level += s->filter.level; 1234 filter_level += s->filter.level;
1235 } else 1235 } else
1236 filter_level = s->filter.level; 1236 filter_level = s->filter.level;
1237 1237