Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: source/libvpx/vp9/common/vp9_entropy.h

Issue 23530058: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_debugmodes.c ('k') | source/libvpx/vp9/common/vp9_entropy.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_entropy.h
===================================================================
--- source/libvpx/vp9/common/vp9_entropy.h (revision 223100)
+++ source/libvpx/vp9/common/vp9_entropy.h (working copy)
@@ -95,7 +95,7 @@
#define MODULUS_PARAM 13 /* Modulus parameter */
struct VP9Common;
-void vp9_default_coef_probs(struct VP9Common *);
+void vp9_default_coef_probs(struct VP9Common *cm);
extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_4x4[16]);
extern DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_4x4[16]);
@@ -154,7 +154,7 @@
vp9_default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]);
void vp9_coef_tree_initialize(void);
-void vp9_adapt_coef_probs(struct VP9Common *);
+void vp9_adapt_coef_probs(struct VP9Common *cm);
static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
int i;
@@ -336,6 +336,45 @@
}
}
+static int get_entropy_context(const MACROBLOCKD *xd, TX_SIZE tx_size,
+ PLANE_TYPE type, int block_idx,
+ ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L,
+ const int16_t **scan,
+ const uint8_t **band_translate) {
+ ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
+
+ switch (tx_size) {
+ case TX_4X4:
+ *scan = get_scan_4x4(get_tx_type_4x4(type, xd, block_idx));
+ *band_translate = vp9_coefband_trans_4x4;
+ above_ec = A[0] != 0;
+ left_ec = L[0] != 0;
+ break;
+ case TX_8X8:
+ *scan = get_scan_8x8(get_tx_type_8x8(type, xd));
+ *band_translate = vp9_coefband_trans_8x8plus;
+ above_ec = !!*(uint16_t *)A;
+ left_ec = !!*(uint16_t *)L;
+ break;
+ case TX_16X16:
+ *scan = get_scan_16x16(get_tx_type_16x16(type, xd));
+ *band_translate = vp9_coefband_trans_8x8plus;
+ above_ec = !!*(uint32_t *)A;
+ left_ec = !!*(uint32_t *)L;
+ break;
+ case TX_32X32:
+ *scan = vp9_default_scan_32x32;
+ *band_translate = vp9_coefband_trans_8x8plus;
+ above_ec = !!*(uint64_t *)A;
+ left_ec = !!*(uint64_t *)L;
+ break;
+ default:
+ assert(!"Invalid transform size.");
+ }
+
+ return combine_entropy_contexts(above_ec, left_ec);
+}
+
enum { VP9_COEF_UPDATE_PROB = 252 };
#endif // VP9_COMMON_VP9_ENTROPY_H_
« no previous file with comments | « source/libvpx/vp9/common/vp9_debugmodes.c ('k') | source/libvpx/vp9/common/vp9_entropy.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698