From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 109FF478B1 for ; Tue, 26 Sep 2023 22:19:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ECCE068CAD9; Wed, 27 Sep 2023 01:18:00 +0300 (EEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2062.outbound.protection.outlook.com [40.92.90.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0346C68CA73 for ; Wed, 27 Sep 2023 01:17:58 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BhRb9y78KaO/KLVPGm4WOBmHWLTGPrcHGu4RkP09NfUw37wSg9e2lrjI3lm/YT4Ba6q6ZSeYp3dZH7x2jX5MOo5Sj55MX92ryfIc/6Ume6eAsiaVDZBaq1VfNrYUz8FsAOUkZ8h9an1FQhdI+/lXS/X0DcN19aMU/hoN9prmsXuB0T9Ujj/g4+WxONDxpnFZwN8uSHDFN8jhJqploanaTgXeMLURl0IsfqGkt/EsLyIH4Ib9IJCJr0xRqqt9qSUVKGmoL9uPE0WvZwrCZtIFPIrVyI0d61M1SwC0m05+wq/9qzR5+YkW3D8vTNx363WK8lQOxYO4X1Yhjdz/fF41ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=upS2W2uM6bTqYvHZjIkOsP8yJpGNCEdu8CsPxuIxfm4=; b=mD5cS4pV70pRclYXjMveD8kQaCPsS/M8xe4ik0wG6JugEQu5X+We29WLT1alaVQVafVTV3eTcLk3/3TXS/AI07ZMaLSRpqmMYxDcSUhMnjlBXfmZ4p0muUq3u36KQCmwsSaOyY+3OilFHWbV/rV1n0U/QKFIUe9HEoScErks4mgNKJc76TqxbzW21izFhn9SpoDxf3KqA/1rNg4ymFRlVYi7MfH3hkEedPERcAoY6L4XKayQnowuqaTSnv8YqiAXX8Cr868wI8lz+Q+/Li975K/m8R0o42cBgdqBHqZV/icXVe6rTL2tgRNCgNLXYQqw/GKqf5IXCwLWWm64evVK1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=upS2W2uM6bTqYvHZjIkOsP8yJpGNCEdu8CsPxuIxfm4=; b=MQJRihYRNAKgCRTcruTFGDp3LEyQOf19l4nU3Pwmh2P039nvh6tCtJuGzJ5Ks0Kb3PbZbFSLKRFCCEtqXtC7gKMS4b6fhAeS5gFCwdxIDPo6Vi7OlSWFyxKoUeqD6HYj52FKkqekL5LWOBY6gdBocZqjboAKjBaD3x15G8WfpLxe5pz9DkeSl7FOLNzdKmopnCVXXeifJE3AyxFJ9afwhN7I/FFf8xLe6urbBTx/rQSGnjdSR/LTX+7I/KoKDdaN48Fg9Bfy+7IB8/BKgG08Z3Lr25S7QYcdrwWbXtqvzDEOmR9j99l+a/2Ac0Ijo3df4yPoCwjatGeAa2NZ0i4nIQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DU2P250MB0189.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:275::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 26 Sep 2023 22:17:57 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::9d42:7b4f:71ef:c76a%3]) with mapi id 15.20.6813.027; Tue, 26 Sep 2023 22:17:57 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Sep 2023 00:16:52 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [yXCLD9Xlf4rRkCn3EpG/baC6mdCfwyBR] X-ClientProxiedBy: FR3P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20230926221732.3711507-20-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DU2P250MB0189:EE_ X-MS-Office365-Filtering-Correlation-Id: 51abd9bc-1e07-42e1-dc2d-08dbbede6fbc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xdH68mGnUbf88sEasMWaA97fSe/qdFmViG51MECuyA+E7o5PZoPj/x58ep1A+4nGCKbLgfLwt+WtpCcBfuag37LwAcXgoK9yiMtWXbX+6mCDSRN2T2ApNgpafOBDGSHg1BxhV6LeJrUVciypYF+ui9U8Tvj1ReMgC3xj1hMBu/pHUP2FpeGJMcLJzc3+6ztSTCuM2k3uMd3/v8IczEdDeq/wkq+JxhqO1EgA1nkyRz5+w6AJfSZT9xvyYReLJweS1536LXwbWK1Ad2OhIm+l4rnZYkC+Wdmef8hQ44U5TgV0IwtZY5nWvisyViHOUy+6XNON/Uo2aIFMigEQrMHxnNINpvTRqltU1ZP2nDj2hbwGQr40UgKb5oaY24JG/RJrv2WD8fYcNuGxemYHxr9G8bjiiPfS+kA/EHk0QdgFynQzoMuBUsJK+mwTzhtpZ/XHgoaQFeCmsuuGkwyEpWm/lAC2yA8onpfoelUBUlRixoymumgwQ8/nZxZsTiAyH8YZRtQCtUfZaeZrJlhg0pdz2qwUVHcWtdhx9y7NeFHSSJOfQZ9HjV0Yyfd+TxXjkNHeR5qiOOT7Oq/BKeZrDYQU3piSJNEP98VTdWzIVt08p7xezuabnT8RY1d7RK2pPtBc X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7euUvwhBZoP067307IiD2LZHfgPiGZpWDdHCKRAxKStaw+B9Lk3yP5QC2/2I?= =?us-ascii?Q?lJuQ4W4mVmVtYGo7ZLBJiIQTP+dra6+4AdV+kxwOujeJKQZqeFWrBol4ehIA?= =?us-ascii?Q?MBTlZlxWepFzfNBCwR4yy3JPDD5/YZuVA97ikiLrWdM+jqDE8ouSl17L+4Cr?= =?us-ascii?Q?PdXBA2KNFEzcF7esAGWXs0u2ytmBCDVY2TEXWijXhhrN2vvar++/D5SSQ3QM?= =?us-ascii?Q?pyvympD/LaMc6GokzhyebxdXlfKOzLL+HWK55OqOvlLu8lhskGP+EIZVipQX?= =?us-ascii?Q?sj7Qbhp9Km+EsjjFjHmBUur0JgL9tfE0aIZKGPCJEXwEt0vQEtNtSVEMdhyD?= =?us-ascii?Q?OfDp5OlVEBEmQog9NYag/A+IhGfph4od9weLS/M3zHyuwZHMtGL7Fm/gnx8U?= =?us-ascii?Q?F+kKlABEuK2Wsa/FrOmy30TPJChwyDfSSZ5HFhjOc0zaFiurXP6XiHYvJCHM?= =?us-ascii?Q?p/6njcGjCEq6mmXIzFAK4Wm1A/ZJm2XRGaoFKZsKVruuSNv/pJXJXBwU/8GH?= =?us-ascii?Q?6Yz9zdOKPCwogjcEDruPqGkLzHls3EOyzZcBXLLnZjeQPmdlSKkzVtnVHnla?= =?us-ascii?Q?s1xd4Jr0hrWTBl6j1BKuBtBlf4Z83RNx7lKqHjsUxm7qYhJXb2ckewa+Adrv?= =?us-ascii?Q?uH5nE4/JyU31DcnZMo6TbnCH6fpkVapdRwxEMoMyrcsAkLHJrw9DUfXQF+TW?= =?us-ascii?Q?u8mpEI+N2q3Hjggfs+TJnU/fjjUAwCd8OqbYULP7wqrHhL4fykk5Od254Drn?= =?us-ascii?Q?RYcqBzifxQubTrjSc9TcDRJlZzDQ5ozYQPFHOsWuDokGV8iT89HH2B1lHCos?= =?us-ascii?Q?x4RIbKlIpvbPUngRstUPjz8wVUHz1VpqpqSQZaYyetjbGVpgsnaWT6ewAom5?= =?us-ascii?Q?5cZs+VYpAEG2hLMswcmabazK8iAjzLHCBNAs1I7CG71ePJ4HF7RH2oFXwAKC?= =?us-ascii?Q?bBHAzP3wd8yZXI/NVu7/DvBeywhgz09XSTCS774OQbvpCf22EcoQVnCium73?= =?us-ascii?Q?g08Fw1huYIht9KXer9zYXudK3YaILsyi+IjClapw1xw8JU1LE0Lbstrm9OFk?= =?us-ascii?Q?HgFU56WectS8pTZsaOesIIqCiXD6Jl0yV2j6DBg4r9e0NM64dNNPQFd4B9PW?= =?us-ascii?Q?brKV28DHesc73EoNpCFeoq3Z4ROXkESsapFVwo9m0vRoVrAOWD9Al3gN/xuN?= =?us-ascii?Q?ENWvrtK6GO62b1quPQzJScoH8hoTO9D91A2rMuerhDm+USnIkILX2Nbo39MV?= =?us-ascii?Q?ZZgxwpghJ1L7K8hk3usM?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51abd9bc-1e07-42e1-dc2d-08dbbede6fbc X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 22:17:57.1953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0189 Subject: [FFmpeg-devel] [PATCH 21/61] avcodec/vp3: Share coefficient VLCs between threads X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: These VLCs are very big: The VP3 one have 164382 elements but due to the overallocation enough memory for 313344 elements are allocated (1.195 MiB with sizeof(VLCElem) == 4); for VP4 the numbers are very similar, namely 311296 and 164392 elements. Since 1f4cf92cfbd3accbae582ac63126ed5570ddfd37, each frame thread has its own copy of these VLCs. This commit fixes this by sharing these VLCs across threads. The approach used here will also make it easier to support stream reconfigurations in case of frame-multithreading in the future. Signed-off-by: Andreas Rheinhardt --- libavcodec/vp3.c | 99 +++++++++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 34 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 0463909f2f..1abf7e8078 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -45,8 +45,10 @@ #include "decode.h" #include "get_bits.h" #include "hpeldsp.h" +#include "internal.h" #include "jpegquanttables.h" #include "mathops.h" +#include "refstruct.h" #include "thread.h" #include "threadframe.h" #include "videodsp.h" @@ -187,6 +189,10 @@ typedef struct HuffTable { uint8_t nb_entries; } HuffTable; +typedef struct CoeffVLCs { + VLC vlcs[80]; +} CoeffVLCs; + typedef struct Vp3DecodeContext { AVCodecContext *avctx; int theora, theora_tables, theora_header; @@ -289,9 +295,12 @@ typedef struct Vp3DecodeContext { int *nkf_coded_fragment_list; int num_kf_coded_fragment[3]; - /* The first 16 of the following VLCs are for the dc coefficients; - the others are four groups of 16 VLCs each for ac coefficients. */ - VLC coeff_vlc[5 * 16]; + /** + * The first 16 of the following VLCs are for the dc coefficients; + * the others are four groups of 16 VLCs each for ac coefficients. + * This is a RefStruct reference to share these VLCs between threads. + */ + CoeffVLCs *coeff_vlc; /* these arrays need to be on 16-byte boundaries since SSE2 operations * index into them */ @@ -365,8 +374,7 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) av_frame_free(&s->last_frame.f); av_frame_free(&s->golden_frame.f); - for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) - ff_vlc_free(&s->coeff_vlc[i]); + ff_refstruct_unref(&s->coeff_vlc); return 0; } @@ -1295,13 +1303,14 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, */ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { + const VLC *coeff_vlc = s->coeff_vlc->vlcs; int dc_y_table; int dc_c_table; int ac_y_table; int ac_c_table; int residual_eob_run = 0; - VLC *y_tables[64]; - VLC *c_tables[64]; + const VLC *y_tables[64]; + const VLC *c_tables[64]; s->dct_tokens[0][0] = s->dct_tokens_base; @@ -1313,7 +1322,7 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) dc_c_table = get_bits(gb, 4); /* unpack the Y plane DC coefficients */ - residual_eob_run = unpack_vlcs(s, gb, &s->coeff_vlc[dc_y_table], 0, + residual_eob_run = unpack_vlcs(s, gb, &coeff_vlc[dc_y_table], 0, 0, residual_eob_run); if (residual_eob_run < 0) return residual_eob_run; @@ -1324,11 +1333,11 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) reverse_dc_prediction(s, 0, s->fragment_width[0], s->fragment_height[0]); /* unpack the C plane DC coefficients */ - residual_eob_run = unpack_vlcs(s, gb, &s->coeff_vlc[dc_c_table], 0, + residual_eob_run = unpack_vlcs(s, gb, &coeff_vlc[dc_c_table], 0, 1, residual_eob_run); if (residual_eob_run < 0) return residual_eob_run; - residual_eob_run = unpack_vlcs(s, gb, &s->coeff_vlc[dc_c_table], 0, + residual_eob_run = unpack_vlcs(s, gb, &coeff_vlc[dc_c_table], 0, 2, residual_eob_run); if (residual_eob_run < 0) return residual_eob_run; @@ -1350,23 +1359,23 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) /* build tables of AC VLC tables */ for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ - y_tables[i] = &s->coeff_vlc[ac_y_table + 16]; - c_tables[i] = &s->coeff_vlc[ac_c_table + 16]; + y_tables[i] = &coeff_vlc[ac_y_table + 16]; + c_tables[i] = &coeff_vlc[ac_c_table + 16]; } for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ - y_tables[i] = &s->coeff_vlc[ac_y_table + 32]; - c_tables[i] = &s->coeff_vlc[ac_c_table + 32]; + y_tables[i] = &coeff_vlc[ac_y_table + 32]; + c_tables[i] = &coeff_vlc[ac_c_table + 32]; } for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ - y_tables[i] = &s->coeff_vlc[ac_y_table + 48]; - c_tables[i] = &s->coeff_vlc[ac_c_table + 48]; + y_tables[i] = &coeff_vlc[ac_y_table + 48]; + c_tables[i] = &coeff_vlc[ac_c_table + 48]; } for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ - y_tables[i] = &s->coeff_vlc[ac_y_table + 64]; - c_tables[i] = &s->coeff_vlc[ac_c_table + 64]; + y_tables[i] = &coeff_vlc[ac_y_table + 64]; + c_tables[i] = &coeff_vlc[ac_c_table + 64]; } /* decode all AC coefficients */ @@ -1517,6 +1526,7 @@ static void vp4_set_tokens_base(Vp3DecodeContext *s) static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { + const VLC *coeff_vlc = s->coeff_vlc->vlcs; int dc_y_table; int dc_c_table; int ac_y_table; @@ -1539,27 +1549,27 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) /* build tables of DC/AC VLC tables */ /* DC table group */ - tables[0][0] = &s->coeff_vlc[dc_y_table]; - tables[1][0] = &s->coeff_vlc[dc_c_table]; + tables[0][0] = &coeff_vlc[dc_y_table]; + tables[1][0] = &coeff_vlc[dc_c_table]; for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ - tables[0][i] = &s->coeff_vlc[ac_y_table + 16]; - tables[1][i] = &s->coeff_vlc[ac_c_table + 16]; + tables[0][i] = &coeff_vlc[ac_y_table + 16]; + tables[1][i] = &coeff_vlc[ac_c_table + 16]; } for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ - tables[0][i] = &s->coeff_vlc[ac_y_table + 32]; - tables[1][i] = &s->coeff_vlc[ac_c_table + 32]; + tables[0][i] = &coeff_vlc[ac_y_table + 32]; + tables[1][i] = &coeff_vlc[ac_c_table + 32]; } for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ - tables[0][i] = &s->coeff_vlc[ac_y_table + 48]; - tables[1][i] = &s->coeff_vlc[ac_c_table + 48]; + tables[0][i] = &coeff_vlc[ac_y_table + 48]; + tables[1][i] = &coeff_vlc[ac_c_table + 48]; } for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ - tables[0][i] = &s->coeff_vlc[ac_y_table + 64]; - tables[1][i] = &s->coeff_vlc[ac_c_table + 64]; + tables[0][i] = &coeff_vlc[ac_y_table + 64]; + tables[1][i] = &coeff_vlc[ac_c_table + 64]; } vp4_set_tokens_base(s); @@ -2355,6 +2365,14 @@ static av_cold int init_frames(Vp3DecodeContext *s) return 0; } +static av_cold void free_vlc_tables(FFRefStructOpaque unused, void *obj) +{ + CoeffVLCs *vlcs = obj; + + for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) + ff_vlc_free(&vlcs->vlcs[i]); +} + static av_cold int vp3_decode_init(AVCodecContext *avctx) { static AVOnce init_static_once = AV_ONCE_INIT; @@ -2443,8 +2461,6 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->fragment_start[2] = y_fragment_count + c_fragment_count; if (!s->theora_tables) { - const uint8_t (*bias_tabs)[32][2]; - for (int i = 0; i < 64; i++) { s->coded_dc_scale_factor[0][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_y_dc_scale_factor[i]; s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i]; @@ -2463,11 +2479,23 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->qr_base[inter][plane][1] = 2 * inter + (!!plane) * !inter; } } + } + + if (!avctx->internal->is_copy) { + CoeffVLCs *vlcs = ff_refstruct_alloc_ext(sizeof(*s->coeff_vlc), 0, + NULL, free_vlc_tables); + if (!vlcs) + return AVERROR(ENOMEM); + + s->coeff_vlc = vlcs; + + if (!s->theora_tables) { + const uint8_t (*bias_tabs)[32][2]; /* init VLC tables */ bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; - for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, 32, + for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { + ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, 32, &bias_tabs[i][0][1], 2, &bias_tabs[i][0][0], 2, 1, 0, 0, avctx); @@ -2475,10 +2503,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; } } else { - for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { + for (int i = 0; i < FF_ARRAY_ELEMS(vlcs->vlcs); i++) { const HuffTable *tab = &s->huffman_table[i]; - ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, + ret = ff_vlc_init_from_lengths(&vlcs->vlcs[i], 11, tab->nb_entries, &tab->entries[0].len, sizeof(*tab->entries), &tab->entries[0].sym, sizeof(*tab->entries), 1, 0, 0, avctx); @@ -2486,6 +2514,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; } } + } ff_thread_once(&init_static_once, init_tables_once); @@ -2534,6 +2563,8 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * const Vp3DecodeContext *s1 = src->priv_data; int qps_changed = 0, err; + ff_refstruct_replace(&s->coeff_vlc, s1->coeff_vlc); + if (!s1->current_frame.f->data[0] || s->width != s1->width || s->height != s1->height) { if (s != s1) -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".