@@ -162,6 +162,7 @@ static av_always_inline void generate(int8_t *out, int out_stride,
{
const uint8_t shift = h274->log2_scale_factor + 6;
const uint16_t avg = avg_8x8_c(in, in_stride);
+ const uint8_t num_values = h274->num_model_values[c];
int16_t scale;
uint8_t h, v;
int8_t s = -1;
@@ -191,8 +192,8 @@ static av_always_inline void generate(int8_t *out, int out_stride,
return;
}
- h = av_clip(h274->comp_model_value[c][s][1], 2, 14) - 2;
- v = av_clip(h274->comp_model_value[c][s][2], 2, 14) - 2;
+ h = num_values > 1 ? av_clip(h274->comp_model_value[c][s][1], 2, 14) - 2 : 6;
+ v = num_values > 2 ? av_clip(h274->comp_model_value[c][s][2], 2, 14) - 2 : h;
init_slice(database, h, v);
scale = h274->comp_model_value[c][s][0];