From: "Dai, Jianhui J" <jianhui.j.dai-at-intel.com@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH V2] vcodec/vp8data: Move ff_vp8_dct_cat_prob to vp8data.c
Date: Tue, 9 May 2023 05:28:26 +0000
Message-ID: <DM6PR11MB268150B996C485DE22513D7DB1769@DM6PR11MB2681.namprd11.prod.outlook.com> (raw)
Avoid compiling error if included by multiple sources.
Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
---
libavcodec/Makefile | 4 ++--
libavcodec/vp8data.c | 42 ++++++++++++++++++++++++++++++++++++++++++
libavcodec/vp8data.h | 20 +-------------------
3 files changed, 45 insertions(+), 21 deletions(-)
create mode 100644 libavcodec/vp8data.c
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b0971ce833..3cf4444b7e 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -762,8 +762,8 @@ OBJS-$(CONFIG_VP3_DECODER) += vp3.o jpegquanttables.o
OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vpx_rac.o
OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
vp6dsp.o vpx_rac.o
-OBJS-$(CONFIG_VP7_DECODER) += vp8.o vpx_rac.o
-OBJS-$(CONFIG_VP8_DECODER) += vp8.o vpx_rac.o
+OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8data.o vpx_rac.o
+OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8data.o vpx_rac.o
OBJS-$(CONFIG_VP8_CUVID_DECODER) += cuviddec.o
OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER) += mediacodecdec.o
OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec.o
diff --git a/libavcodec/vp8data.c b/libavcodec/vp8data.c
new file mode 100644
index 0000000000..a41fc872f5
--- /dev/null
+++ b/libavcodec/vp8data.c
@@ -0,0 +1,42 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "stdint.h"
+
+// cat 1 and 2 are defined in vp8data.h
+static const uint8_t vp8_dct_cat3_prob[] = {
+ 173, 148, 140, 0
+};
+static const uint8_t vp8_dct_cat4_prob[] = {
+ 176, 155, 140, 135, 0
+};
+static const uint8_t vp8_dct_cat5_prob[] = {
+ 180, 157, 141, 134, 130, 0
+};
+static const uint8_t vp8_dct_cat6_prob[] = {
+ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
+};
+
+// only used for cat3 and above; cat 1 and 2 are referenced directly.
+const uint8_t *const ff_vp8_dct_cat_prob[] = {
+ vp8_dct_cat3_prob,
+ vp8_dct_cat4_prob,
+ vp8_dct_cat5_prob,
+ vp8_dct_cat6_prob,
+};
+
diff --git a/libavcodec/vp8data.h b/libavcodec/vp8data.h
index 1fcce134eb..8b8f1ed111 100644
--- a/libavcodec/vp8data.h
+++ b/libavcodec/vp8data.h
@@ -339,26 +339,8 @@ static const uint8_t vp8_dct_cat1_prob[] = {
static const uint8_t vp8_dct_cat2_prob[] = {
165, 145, 0
};
-static const uint8_t vp8_dct_cat3_prob[] = {
- 173, 148, 140, 0
-};
-static const uint8_t vp8_dct_cat4_prob[] = {
- 176, 155, 140, 135, 0
-};
-static const uint8_t vp8_dct_cat5_prob[] = {
- 180, 157, 141, 134, 130, 0
-};
-static const uint8_t vp8_dct_cat6_prob[] = {
- 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
-};
-// only used for cat3 and above; cat 1 and 2 are referenced directly
-const uint8_t *const ff_vp8_dct_cat_prob[] = {
- vp8_dct_cat3_prob,
- vp8_dct_cat4_prob,
- vp8_dct_cat5_prob,
- vp8_dct_cat6_prob,
-};
+extern const uint8_t *const ff_vp8_dct_cat_prob[];
static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS - 1] = {
{
--
2.25.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".
next reply other threads:[~2023-05-09 5:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 5:28 Dai, Jianhui J [this message]
2023-05-10 11:17 ` Ronald S. Bultje
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR11MB268150B996C485DE22513D7DB1769@DM6PR11MB2681.namprd11.prod.outlook.com \
--to=jianhui.j.dai-at-intel.com@ffmpeg.org \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git