History

Merge "Cleaning up decode_coefs() function."

Dmitry Kovalev committed 13 years ago

Commit 8282c1a2 parents 697846d 11631fe2 files · +10 −12Browse files

Unified · Split

2 files
  1. vp9/decoder/vp9_detokenize.c +10 −10
  2. vp9/decoder/vp9_treereader.h +0 −2
vp9/decoder/vp9_detokenize.c+10−10
@@ -67,27 +67,27 @@ static const int token_to_counttoken[MAX_ENTROPY_TOKENS] = { · 66 unmodified lines
6767 TWO_TOKEN, TWO_TOKEN, TWO_TOKEN, DCT_EOB_MODEL_TOKEN
6868 };
6969
70−#define INCREMENT_COUNT(token) \
71− do { \
72− if (!cm->frame_parallel_decoding_mode) { \
70+#define INCREMENT_COUNT(token) \
71+ do { \
72+ if (!cm->frame_parallel_decoding_mode) \
7373 ++coef_counts[band][pt][token_to_counttoken[token]]; \
74− } \
75− } while (0);
74+ } while (0)
75+
7676
7777 #define WRITE_COEF_CONTINUE(val, token) \
7878 { \
79− dqcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * \
79+ dqcoeff_ptr[scan[c]] = (vp9_read_bit(r) ? -val : val) * \
8080 dq[c > 0] / (1 + (tx_size == TX_32X32)); \
8181 INCREMENT_COUNT(token); \
8282 token_cache[scan[c]] = vp9_pt_energy_class[token]; \
83− c++; \
83+ ++c; \
8484 continue; \
8585 }
8686
8787 #define ADJUST_COEF(prob, bits_count) \
8888 do { \
8989 val += (vp9_read(r, prob) << bits_count); \
90− } while (0);
90+ } while (0)
9191
9292 static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
9393 vp9_reader *r, int block_idx,
@@ -201,10 +201,10 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, · 107 unmodified lines
201201 }
202202 val = 0;
203203 cat6 = cat6_prob;
204− while (*cat6) {
204+ while (*cat6)
205205 val = (val << 1) | vp9_read(r, *cat6++);
206− }
207206 val += CAT6_MIN_VAL;
207+
208208 WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY6);
209209 }
210210
vp9/decoder/vp9_treereader.h+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515 #include "vp9/common/vp9_treecoder.h"
1616 #include "vp9/decoder/vp9_dboolhuff.h"
1717
18−#define vp9_read_and_apply_sign(r, value) (vp9_read_bit(r) ? -(value) : (value))
19−
2018 // Intent of tree data structure is to make decoding trivial.
2119 static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */
2220 vp9_tree t,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t