ref: d975804e9abcff9c6c2c3c3384ceb3dc04f5c087
parent: 934c4e66214b1ec851aa1e0690da94cc39875fee
parent: 8b34437522fc16b9c557dbac8074ed2a23daa72b
author: Dmitry Kovalev <[email protected]>
date: Thu Oct 3 14:58:40 EDT 2013
Merge "Replacing duplicated code with get_scan_and_band call."
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -667,6 +667,7 @@
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
const int num_4x4_w = num_4x4_blocks_wide_lookup[bs];
const int num_4x4_h = num_4x4_blocks_high_lookup[bs];
+ const uint8_t *band_translate; // just for the get_scan_and_band call
struct rdcost_block_args args = { x, { 0 }, { 0 }, tx_size,
num_4x4_w, num_4x4_h,
@@ -678,26 +679,9 @@
vp9_get_entropy_contexts(tx_size, args.t_above, args.t_left,
pd->above_context, pd->left_context,
num_4x4_w, num_4x4_h);
- switch (tx_size) {
- case TX_4X4:
- get_scan_nb_4x4(get_tx_type_4x4(pd->plane_type, xd, 0),
- &args.scan, &args.nb);
- break;
- case TX_8X8:
- get_scan_nb_8x8(get_tx_type_8x8(pd->plane_type, xd),
- &args.scan, &args.nb);
- break;
- case TX_16X16:
- get_scan_nb_16x16(get_tx_type_16x16(pd->plane_type, xd),
- &args.scan, &args.nb);
- break;
- case TX_32X32:
- args.scan = vp9_default_scan_32x32;
- args.nb = vp9_default_scan_32x32_neighbors;
- break;
- default:
- assert(0);
- }
+
+ get_scan_and_band(xd, tx_size, pd->plane_type, 0, &args.scan, &args.nb,
+ &band_translate);
foreach_transformed_block_in_plane(xd, bsize, plane, block_yrd_txfm, &args);
if (args.skip) {