Add get_plane_type() helper function.
Adds the static inline function get_plane_type to convert a plane number
to the corresponding PLANE_TYPE.
There's no change to the bitstream, it only encapsulates the logic to
get the PLANE_TYPE.
Change-Id: I1199db3a32c89437d9c029ab5b2b2e62582a13a2
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 12a0004..2368294 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -503,7 +503,7 @@
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
#endif
- PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
+ PLANE_TYPE plane_type = get_plane_type(plane);
const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);
TX_TYPE tx_type = get_tx_type(plane_type, xd, block_raster_idx, tx_size);
const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
@@ -976,7 +976,7 @@
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
tran_low_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
+ PLANE_TYPE plane_type = get_plane_type(plane);
const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);
const TX_TYPE tx_type =
get_tx_type(plane_type, xd, block_raster_idx, tx_size);