Ticket #67327: patch-libavcodec-libsvtav1.c.diff

File patch-libavcodec-libsvtav1.c.diff, 1.1 KB (added by townba (Brad Town), 18 months ago)

Patch based on upstream commit 031f1561cd286596cdb374da32f8aa816ce3b135

Line 
1--- libavcodec/libsvtav1.c.orig 2023-05-05 16:13:02
2+++ libavcodec/libsvtav1.c      2023-05-05 16:05:27
3avcodec/libsvtav1: remove compressed_ten_bit_format and simplify alloc_buffer
4* From https://gitlab.com/1480c1/FFmpeg/-/commit/031f1561cd286596cdb374da32f8aa816ce3b135
5@@ -124,16 +124,12 @@
6 
7 static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc)
8 {
9-    const int    pack_mode_10bit =
10-        (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0;
11-    const size_t luma_size_8bit  =
12-        config->source_width * config->source_height * (1 << pack_mode_10bit);
13-    const size_t luma_size_10bit =
14-        (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0;
15+    const size_t luma_size = config->source_width * config->source_height *
16+        (config->encoder_bit_depth > 8 ? 2 : 1);
17 
18     EbSvtIOFormat *in_data;
19 
20-    svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2;
21+    svt_enc->raw_size = luma_size * 3 / 2;
22 
23     // allocate buffer for in and out
24     svt_enc->in_buf           = av_mallocz(sizeof(*svt_enc->in_buf));