You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avfilter/scene_sad: pass true depth to ff_scene_sad_get_fn()
I need to be able to distinguish between 10/12/14 and 16 bit depths, for overflow reasons.
This commit is contained in:
@ -272,7 +272,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
|
||||
|
||||
if (CONFIG_SELECT_FILTER && select->do_scene_detect) {
|
||||
select->sad = ff_scene_sad_get_fn(select->bitdepth == 8 ? 8 : 16);
|
||||
select->sad = ff_scene_sad_get_fn(select->bitdepth);
|
||||
if (!select->sad)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
@ -63,11 +63,10 @@ ff_scene_sad_fn ff_scene_sad_get_fn(int depth)
|
||||
sad = ff_scene_sad_get_fn_x86(depth);
|
||||
#endif
|
||||
if (!sad) {
|
||||
if (depth == 8)
|
||||
if (depth <= 8)
|
||||
sad = ff_scene_sad_c;
|
||||
if (depth == 16)
|
||||
else if (depth <= 16)
|
||||
sad = ff_scene_sad16_c;
|
||||
}
|
||||
return sad;
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
|
||||
s->bitdepth = pix_desc->comp[0].depth;
|
||||
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth == 8 ? 8 : 16);
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth);
|
||||
if (!s->sad)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
|
@ -103,7 +103,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
s->height[plane] = inlink->h >> ((plane == 1 || plane == 2) ? pix_desc->log2_chroma_h : 0);
|
||||
}
|
||||
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth == 8 ? 8 : 16);
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth);
|
||||
if (!s->sad)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
|
@ -304,7 +304,7 @@ static int config_input_ref(AVFilterLink *inlink)
|
||||
s->filter_slice = !s->is_msad ? compute_images_identity : compute_images_msad;
|
||||
s->filter_line = desc->comp[0].depth > 8 ? identity_line_16bit : identity_line_8bit;
|
||||
|
||||
s->sad = ff_scene_sad_get_fn(desc->comp[0].depth <= 8 ? 8 : 16);
|
||||
s->sad = ff_scene_sad_get_fn(desc->comp[0].depth);
|
||||
if (!s->sad)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
|
@ -387,7 +387,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
}
|
||||
|
||||
if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
|
||||
mi_ctx->sad = ff_scene_sad_get_fn(mi_ctx->bitdepth == 8 ? 8 : 16);
|
||||
mi_ctx->sad = ff_scene_sad_get_fn(mi_ctx->bitdepth);
|
||||
if (!mi_ctx->sad)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
s->height[plane] = inlink->h >> ((plane == 1 || plane == 2) ? desc->log2_chroma_h : 0);
|
||||
}
|
||||
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth == 8 ? 8 : 16);
|
||||
s->sad = ff_scene_sad_get_fn(s->bitdepth);
|
||||
if (!s->sad)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
|
@ -47,7 +47,7 @@ ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth)
|
||||
{
|
||||
#if HAVE_X86ASM
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
if (depth == 8) {
|
||||
if (depth <= 8) {
|
||||
#if HAVE_AVX2_EXTERNAL
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags))
|
||||
return scene_sad_avx2;
|
||||
|
Reference in New Issue
Block a user