ref: af0375ca35ea4b6142364613bdc6a4afb60de665
parent: fc3777b44c0449180073665eb78070d388b11738
author: Luc Trudeau <ltrudeau@twoorioles.com>
date: Fri May 17 08:44:23 EDT 2019
small code cleaning in intra_edge init_mode
--- a/src/intra_edge.c
+++ b/src/intra_edge.c
@@ -112,13 +112,11 @@
const int top_has_right,
const int left_has_bottom)
{
- int n;
-
init_edges(&nwc->node, bl,
(top_has_right ? ALL_FL(TOP_HAS_RIGHT) : 0) |
(left_has_bottom ? ALL_FL(LEFT_HAS_BOTTOM) : 0));
if (bl == BL_16X16) {
- for (n = 0; n < 4; n++) {
+ for (int n = 0; n < 4; n++) {
EdgeTip *const nt = mem->nt++;
nwc->split[n] = &nt->node;
init_edges(&nt->node, bl + 1,
@@ -128,7 +126,7 @@
ALL_FL(LEFT_HAS_BOTTOM)));
}
} else {
- for (n = 0; n < 4; n++) {
+ for (int n = 0; n < 4; n++) {
EdgeBranch *const nwc_child = mem->nwc[bl]++;
nwc->split[n] = &nwc_child->node;
init_mode_node(nwc_child, bl + 1, mem,
@@ -143,12 +141,12 @@
{
EdgeBranch *const root = (EdgeBranch *) root_node;
struct ModeSelMem mem;
+ mem.nt = nt;
if (allow_sb128) {
mem.nwc[BL_128X128] = &root[1];
mem.nwc[BL_64X64] = &root[1 + 4];
mem.nwc[BL_32X32] = &root[1 + 4 + 16];
- mem.nt = nt;
init_mode_node(root, BL_128X128, &mem, 1, 0);
assert(mem.nwc[BL_128X128] == &root[1 + 4]);
assert(mem.nwc[BL_64X64] == &root[1 + 4 + 16]);
@@ -158,7 +156,6 @@
mem.nwc[BL_128X128] = NULL;
mem.nwc[BL_64X64] = &root[1];
mem.nwc[BL_32X32] = &root[1 + 4];
- mem.nt = nt;
init_mode_node(root, BL_64X64, &mem, 1, 0);
assert(mem.nwc[BL_64X64] == &root[1 + 4]);
assert(mem.nwc[BL_32X32] == &root[1 + 4 + 16]);