Skip to content

Commit 895f7e2

Browse files
committed
SVT: remove 'chroma' parameter as SVT only supports 4:2:0
1 parent a24d97a commit 895f7e2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

libheif/plugins/encoder_svt.cc

+9-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct encoder_struct_svt
5757
};
5858
uint8_t tune = Tune_PSNR;
5959

60-
heif_chroma chroma = heif_chroma_420;
60+
heif_chroma chroma = heif_chroma_420; // SVT-AV1 only supports 4:2:0 as of v3.0.0
6161

6262
// --- output
6363

@@ -205,6 +205,7 @@ static void svt_init_parameters()
205205
d[i++] = p++;
206206
#endif
207207

208+
#if 0
208209
assert(i < MAX_NPARAMETERS);
209210
p->version = 2;
210211
p->name = kParam_chroma;
@@ -213,6 +214,7 @@ static void svt_init_parameters()
213214
p->has_default = true;
214215
p->string.valid_values = kParam_chroma_valid_values;
215216
d[i++] = p++;
217+
#endif
216218

217219
assert(i < MAX_NPARAMETERS);
218220
p->version = 2;
@@ -470,6 +472,7 @@ struct heif_error svt_set_parameter_string(void* encoder_raw, const char* name,
470472
{
471473
auto* encoder = (struct encoder_struct_svt*) encoder_raw;
472474

475+
#if 0
473476
if (strcmp(name, kParam_chroma) == 0) {
474477
if (strcmp(value, "420") == 0) {
475478
encoder->chroma = heif_chroma_420;
@@ -487,6 +490,7 @@ struct heif_error svt_set_parameter_string(void* encoder_raw, const char* name,
487490
return heif_error_invalid_parameter_value;
488491
}
489492
}
493+
#endif
490494

491495
if (strcmp(name, kParam_tune) == 0) {
492496
if (strcmp(value, "vq") == 0) {
@@ -519,6 +523,7 @@ struct heif_error svt_get_parameter_string(void* encoder_raw, const char* name,
519523
{
520524
auto* encoder = (struct encoder_struct_svt*) encoder_raw;
521525

526+
#if 0
522527
if (strcmp(name, kParam_chroma) == 0) {
523528
switch (encoder->chroma) {
524529
case heif_chroma_420:
@@ -536,6 +541,7 @@ struct heif_error svt_get_parameter_string(void* encoder_raw, const char* name,
536541
}
537542
return heif_error_ok;
538543
}
544+
#endif
539545

540546
if (strcmp(name, kParam_tune) == 0) {
541547
switch (encoder->tune) {
@@ -592,10 +598,10 @@ void svt_query_input_colorspace(heif_colorspace* colorspace, heif_chroma* chroma
592598

593599
void svt_query_input_colorspace2(void* encoder_raw, heif_colorspace* colorspace, heif_chroma* chroma)
594600
{
595-
auto* encoder = (struct encoder_struct_svt*) encoder_raw;
601+
//auto* encoder = (struct encoder_struct_svt*) encoder_raw;
596602

597603
*colorspace = heif_colorspace_YCbCr;
598-
*chroma = encoder->chroma;
604+
*chroma = heif_chroma_420;
599605
}
600606

601607

0 commit comments

Comments
 (0)