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 1E08448643 for ; Tue, 12 Dec 2023 08:02:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 98B7B68D1AE; Tue, 12 Dec 2023 10:02:32 +0200 (EET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B81B168D009 for ; Tue, 12 Dec 2023 10:02:26 +0200 (EET) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40c38de1ee4so33899935e9.0 for ; Tue, 12 Dec 2023 00:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702368145; x=1702972945; darn=ffmpeg.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=gNnQ7QcnV7/9cwtUdI+WzcslDlIjb8r89hZ34c7VOKo=; b=XCBC9SaGCzNgziQG5En+eUohWG+Q6Y/TMalDR8xjnKIGC37kYDgglgiXZQbcT27BqC cknxGiJwy9E/oMQ2+Cc2r2GRGtrKLKhtRO4fAJSiHl4m/+x+emWT1y7DDsXufsfa6d+w yCyTbCuI8SjdaKOc6aFqKzrafHp1alyHXMNJtLzXYnBexA4WJQsUAGXY1sHb9t0mP5NZ bymeEA14vmdyclAdNJ5JplWZ4h69X1IUmxz6kKgbEupyUMJdMdd+gyUDBxxRY26Xnt// gJvvbmwEK7gjdx94E3mVQkUnfIDiP8TVTNwZZijshD9EWSyI32jw0MSaLVlf1+yPbvoL avDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702368145; x=1702972945; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gNnQ7QcnV7/9cwtUdI+WzcslDlIjb8r89hZ34c7VOKo=; b=YeWXrGZ7tppNH+TeeEHFxygwL/EPT38kFWCnl3VvWA4mpJJZcbM3imudfPvHDCRPlk 9Wxn+vNUwhMQ34v1l7l1KFje8fZciqS4KPSCh8oyxNE+SF6bPctLbC/BSUw1gJcQ8Zdj Y+fvJMPvkGFZU+Ma/Bjg8mNkvLpw3TY+mQyDT/dDOTRHoVmoKkFzYkGdmrEMO56BKpTP lLUw2ap6j1euMbxZ5KkJFENEiy3uyzTC29dxG5YXPsk8vaSLoNvBfe08YuGrhVos9hwR UynVMlGb7cfi2fGI6G8IyMdvzOoVate5R2I/BeSOibVheT1P3MSz43oraJaV3lTPK4d8 KsPQ== X-Gm-Message-State: AOJu0YyWB4fZf91DOjvpf18Yh39u2ezgd40dPOG9e8NjLqXZqKXHjRvU kZb2G+ZgUbis+J7UkR6C6/M1umZXc1c= X-Google-Smtp-Source: AGHT+IFdwFba0GZZcx7ly0KPqCG4d1qda855g9G/Yf2I0kuVhuTMBSwb96fZ99OQ1fKND9Rj8l8YBQ== X-Received: by 2002:a05:600c:3b9f:b0:40c:2878:35ec with SMTP id n31-20020a05600c3b9f00b0040c287835ecmr3042508wms.131.1702368145062; Tue, 12 Dec 2023 00:02:25 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id fa17-20020a05600c519100b0040c46719966sm6924150wmb.25.2023.12.12.00.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 00:02:24 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id C1510BFCDA; Tue, 12 Dec 2023 09:02:23 +0100 (CET) Date: Tue, 12 Dec 2023 09:02:23 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , =?iso-8859-15?Q?Cl=E9ment_B=BDsch?= References: <20231211014429.1841681-1-u@pkh.me> <20231211014429.1841681-5-u@pkh.me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231211014429.1841681-5-u@pkh.me> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 04/35] avcodec/proresenc_anatoliy: move run/lev to codebook LUT to shared proresdata 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: =?iso-8859-15?Q?Cl=E9ment_B=BDsch?= Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Monday 2023-12-11 02:35:05 +0100, Cl=E9ment B=BDsch wrote: > This is going to be shared with proresenc_kostya in the upcoming commit. > --- > libavcodec/proresdata.c | 6 ++++++ > libavcodec/proresdata.h | 2 ++ > libavcodec/proresenc_anatoliy.c | 9 ++------- > 3 files changed, 10 insertions(+), 7 deletions(-) > = > diff --git a/libavcodec/proresdata.c b/libavcodec/proresdata.c > index 4787907c71..12ee43bddd 100644 > --- a/libavcodec/proresdata.c > +++ b/libavcodec/proresdata.c > @@ -43,3 +43,9 @@ const uint8_t ff_prores_interlaced_scan[64] =3D { > 30, 23, 31, 38, 45, 52, 60, 53, > 46, 39, 47, 54, 61, 62, 55, 63 > }; > + > +const uint8_t ff_prores_run_to_cb[16] =3D { 0x06, 0x06, 0x05, 0x05, 0x04= , 0x29, > + 0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x4C }; > + > +const uint8_t ff_prores_lev_to_cb[10] =3D { 0x04, 0x0A, 0x05, 0x06, 0x04= , 0x28, > + 0x28, 0x28, 0x28, 0x4C }; while at it this could employ "lev" =3D> "level" to clarify code and maybe enable some pattern matching trick > diff --git a/libavcodec/proresdata.h b/libavcodec/proresdata.h > index d8c8786689..4d16992892 100644 > --- a/libavcodec/proresdata.h > +++ b/libavcodec/proresdata.h > @@ -29,6 +29,8 @@ > = > extern const uint8_t ff_prores_progressive_scan[64]; > extern const uint8_t ff_prores_interlaced_scan[64]; > +extern const uint8_t ff_prores_run_to_cb[16]; > +extern const uint8_t ff_prores_lev_to_cb[10]; > = > #define FIRST_DC_CB 0xB8 // rice_order =3D 5, exp_golomb_order =3D 6, sw= itch_bits =3D 0 > = > diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anato= liy.c > index e7114f1646..6b2e513bed 100644 > --- a/libavcodec/proresenc_anatoliy.c > +++ b/libavcodec/proresenc_anatoliy.c > @@ -296,11 +296,6 @@ static void encode_dc_coeffs(PutBitContext *pb, int1= 6_t *in, > } > } > = > -static const uint8_t run_to_cb[16] =3D { 0x06, 0x06, 0x05, 0x05, 0x04, 0= x29, > - 0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x4C }; > -static const uint8_t lev_to_cb[10] =3D { 0x04, 0x0A, 0x05, 0x06, 0x04, 0= x28, > - 0x28, 0x28, 0x28, 0x4C }; > - > static void encode_ac_coeffs(PutBitContext *pb, > int16_t *in, int blocks_per_slice, int *qmat, const uint8_t ff_p= rores_scan[64]) > { > @@ -313,14 +308,14 @@ static void encode_ac_coeffs(PutBitContext *pb, > for (j =3D 0; j < blocks_per_slice; j++) { > int val =3D QSCALE(qmat, indp, in[(j << 6) + indp]); > if (val) { > - encode_codeword(pb, run, run_to_cb[FFMIN(prev_run, 15)]); > + encode_codeword(pb, run, ff_prores_run_to_cb[FFMIN(prev_= run, 15)]); > = > prev_run =3D run; > run =3D 0; > level =3D get_level(val); > code =3D level - 1; > = > - encode_codeword(pb, code, lev_to_cb[FFMIN(prev_level, 9)= ]); > + encode_codeword(pb, code, ff_prores_lev_to_cb[FFMIN(prev= _level, 9)]); > = > prev_level =3D level; > = > -- = > 2.43.0 > = > _______________________________________________ > 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". _______________________________________________ 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".