Skip to content

Commit dfc7a12

Browse files
Lusorisclaude
authored andcommitted
feature/adm: apply the 17 pixel minimum to adm_cuda as well
adm_cuda computes the same ceil(log2(w) - 4) shift counts on the host (integer_adm_cuda.c) and is picked for the same frames when a CUDA context is present, so it must refuse what the CPU extractor refuses. Share ADM_MIN_DIM through integer_adm.h and check it at the top of init_fex_cuda(), before any CUDA object is created. Built with CUDA 13.4 and run on an RTX 4090: 16x16, 64x16 fail with "adm_cuda: invalid size" and exit 234, 24x24 scores as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent b8e2a35 commit dfc7a12

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎libvmaf/src/feature/cuda/integer_adm_cuda.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "feature_collector.h"
2727
#include "feature_extractor.h"
2828
#include "feature_name.h"
29+
#include "log.h"
2930

3031
#include "cpu.h"
3132
#include "cuda/integer_adm_cuda.h"
@@ -999,6 +1000,14 @@ static int init_fex_cuda(VmafFeatureExtractor *fex, enum VmafPixelFormat pix_fmt
9991000
(void) pix_fmt;
10001001
(void) bpc;
10011002
int ret = 0;
1003+
1004+
if (w < ADM_MIN_DIM || h < ADM_MIN_DIM) {
1005+
vmaf_log(VMAF_LOG_LEVEL_ERROR,
1006+
"%s: invalid size (%ux%u), width and height must be at least %u\n",
1007+
fex->name, w, h, ADM_MIN_DIM);
1008+
return -EINVAL;
1009+
}
1010+
10021011
CudaFunctions* cu_f = fex->cu_state->f;
10031012
CHECK_CUDA(cu_f, cuCtxPushCurrent(fex->cu_state->ctx));
10041013
CHECK_CUDA(cu_f, cuStreamCreateWithPriority(&s->str, CU_STREAM_NON_BLOCKING, 0));

0 commit comments

Comments
 (0)