Commit 6c6a598c authored by Ezequiel Garcia's avatar Ezequiel Garcia
Browse files

SQUASH: hantro: vp9: Clean and fix segment feature flags



This part is a fix:

-               feature_val = seg_featured_enabled(seg, feature_id, segid) ? 1 : 0;
                feature_id = V4L2_VP9_SEGMENT_FEATURE_SKIP;
+               feature_val = seg_featured_enabled(seg, feature_id, segid) ? 1 : 0;
                hantro_reg_write(ctx->dev, &seg_regs[segid][feature_id], feature_val);

Because feature_val was obtained with the prevoius feature_id.
In order to prevent this issue, I have refactored the function a bit.

Note that the *skip* tests I was debugging are still not passing,
so not sure what else is still wrong. In any case, this looked wrong :)
Signed-off-by: Ezequiel Garcia's avatarEzequiel Garcia <ezequiel@collabora.com>
parent 4411e57c
......@@ -430,35 +430,35 @@ static void config_segment(struct hantro_ctx *ctx, struct hantro_g2_vp9_run *run
absolute = !!(seg->flags & V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE);
for (segid = 0; segid < 8; ++segid) {
feature_val = dec_params->quant.base_q_idx;
/* Quantizer segment feature */
feature_id = V4L2_VP9_SEGMENT_FEATURE_QP_DELTA;
feature_val = dec_params->quant.base_q_idx;
if (segment_enabled && seg_featured_enabled(seg, feature_id, segid))
feature_val = feature_val_clip3(feature_val,
seg->feature_data[segid][feature_id],
absolute, 255);
hantro_reg_write(ctx->dev, &seg_regs[segid][feature_id], feature_val);
feature_val = dec_params->lf.level;
/* Loop filter segment feature */
feature_id = V4L2_VP9_SEGMENT_FEATURE_LF;
feature_val = dec_params->lf.level;
if (segment_enabled && seg_featured_enabled(seg, feature_id, segid))
feature_val = feature_val_clip3(feature_val,
seg->feature_data[segid][feature_id],
absolute, 63);
hantro_reg_write(ctx->dev, &seg_regs[segid][feature_id], feature_val);
feature_val = 0;
/* Reference frame segment feature */
feature_id = V4L2_VP9_SEGMENT_FEATURE_REF_FRAME;
feature_val = 0;
if (!(dec_params->flags & V4L2_VP9_FRAME_FLAG_KEY_FRAME) &&
seg_featured_enabled(seg, feature_id, segid))
feature_val = seg->feature_data[segid][feature_id] + 1;
hantro_reg_write(ctx->dev, &seg_regs[segid][feature_id], feature_val);
feature_val = seg_featured_enabled(seg, feature_id, segid) ? 1 : 0;
/* Skip segment feature */
feature_id = V4L2_VP9_SEGMENT_FEATURE_SKIP;
feature_val = seg_featured_enabled(seg, feature_id, segid) ? 1 : 0;
hantro_reg_write(ctx->dev, &seg_regs[segid][feature_id], feature_val);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment