ref: b865e6c7141f3cb7d56f8868a307fe24905b17a4
parent: 3aff1a37ced8af38a40366490ea2662e9703bd02
author: David Michael Barr <b@rr-dav.id.au>
date: Sat Sep 29 17:07:38 EDT 2018
Simplify conditions for CfL prediction
--- a/src/recon.c
+++ b/src/recon.c
@@ -870,12 +870,12 @@
top_sb_edge, DC_PRED, &angle,
cfl_uv_t_dim->w,
cfl_uv_t_dim->h, edge);
- if (b->cfl_alpha[pl] == 0) {
- dsp->ipred.intra_pred[cfl_uvtx][m](uv_dst[pl], stride,
- edge, 0);
- } else {
+ if (b->cfl_alpha[pl]) {
dsp->ipred.intra_pred[cfl_uvtx][m](&uv_pred[32 * pl],
0, edge, 0);
+ } else {
+ dsp->ipred.intra_pred[cfl_uvtx][m](uv_dst[pl], stride,
+ edge, 0);
}
}
const int furthest_r =
@@ -886,24 +886,19 @@
[cfl_uvtx](ac, y_src, f->cur.p.stride[0],
cbw4 - (furthest_r >> ss_hor),
cbh4 - (furthest_b >> ss_ver));
- if (b->cfl_alpha[0] == 0) {
- dsp->ipred.cfl_pred_1[cfl_uv_t_dim->lw](uv_dst[1],
- stride, ac,
- &uv_pred[32],
- b->cfl_alpha[1],
- cbh4 * 4);
- } else if (b->cfl_alpha[1] == 0) {
- dsp->ipred.cfl_pred_1[cfl_uv_t_dim->lw](uv_dst[0],
- stride, ac,
- uv_pred,
- b->cfl_alpha[0],
- cbh4 * 4);
- } else {
+ if (b->cfl_alpha[0] && b->cfl_alpha[1]) {
dsp->ipred.cfl_pred[cfl_uv_t_dim->lw](uv_dst[0],
uv_dst[1], stride,
ac, uv_pred,
b->cfl_alpha,
cbh4 * 4);
+ } else {
+ const int pl = !b->cfl_alpha[0];
+ dsp->ipred.cfl_pred_1[cfl_uv_t_dim->lw](uv_dst[pl],
+ stride, ac,
+ &uv_pred[32 * pl],
+ b->cfl_alpha[pl],
+ cbh4 * 4);
}
if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
ac_dump(ac, 4*cbw4, 4*cbh4, "ac");