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
67 TWO_TOKEN, TWO_TOKEN, TWO_TOKEN, DCT_EOB_MODEL_TOKEN67 TWO_TOKEN, TWO_TOKEN, TWO_TOKEN, DCT_EOB_MODEL_TOKEN
68};68};
69 69
70#define INCREMENT_COUNT(token) \70#define INCREMENT_COUNT(token) \
71 do { \71 do { \
72 if (!cm->frame_parallel_decoding_mode) { \72 if (!cm->frame_parallel_decoding_mode) \
73 ++coef_counts[band][pt][token_to_counttoken[token]]; \73 ++coef_counts[band][pt][token_to_counttoken[token]]; \
74 } \74 } while (0)
75 } while (0);75
76 76
77#define WRITE_COEF_CONTINUE(val, token) \77#define WRITE_COEF_CONTINUE(val, token) \
78 { \78 { \
79 dqcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * \79 dqcoeff_ptr[scan[c]] = (vp9_read_bit(r) ? -val : val) * \
80 dq[c > 0] / (1 + (tx_size == TX_32X32)); \80 dq[c > 0] / (1 + (tx_size == TX_32X32)); \
81 INCREMENT_COUNT(token); \81 INCREMENT_COUNT(token); \
82 token_cache[scan[c]] = vp9_pt_energy_class[token]; \82 token_cache[scan[c]] = vp9_pt_energy_class[token]; \
83 c++; \83 ++c; \
84 continue; \84 continue; \
85 }85 }
86 86
87#define ADJUST_COEF(prob, bits_count) \87#define ADJUST_COEF(prob, bits_count) \
88 do { \88 do { \
89 val += (vp9_read(r, prob) << bits_count); \89 val += (vp9_read(r, prob) << bits_count); \
90 } while (0);90 } while (0)
91 91
92static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,92static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
93 vp9_reader *r, int block_idx,93 vp9_reader *r, int block_idx,
@@ -201,10 +201,10 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, · 107 unmodified lines
201 }201 }
202 val = 0;202 val = 0;
203 cat6 = cat6_prob;203 cat6 = cat6_prob;
204 while (*cat6) {204 while (*cat6)
205 val = (val << 1) | vp9_read(r, *cat6++);205 val = (val << 1) | vp9_read(r, *cat6++);
206 }
207 val += CAT6_MIN_VAL;206 val += CAT6_MIN_VAL;
207
208 WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY6);208 WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY6);
209 }209 }
210 210
vp9/decoder/vp9_treereader.h+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
15#include "vp9/common/vp9_treecoder.h"15#include "vp9/common/vp9_treecoder.h"
16#include "vp9/decoder/vp9_dboolhuff.h"16#include "vp9/decoder/vp9_dboolhuff.h"
17 17
18#define vp9_read_and_apply_sign(r, value) (vp9_read_bit(r) ? -(value) : (value))
19
20// Intent of tree data structure is to make decoding trivial.18// Intent of tree data structure is to make decoding trivial.
21static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */19static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */
22 vp9_tree t,20 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