History

vcodec/vp8data: Move ff_vp8_dct_cat_prob to vp8data.c

Avoid compiling error if included by multiple sources.

Dai, Jianhui J committed 3 years ago

Commit a4abe371 parent 5ce76503 files · +45 −21Browse files

Unified · Split

3 files
  1. libavcodec/Makefile +2 −2
  2. libavcodec/vp8data.c +42 −0
  3. libavcodec/vp8data.h +1 −19
libavcodec/Makefile+2−2
@@ -762,8 +762,8 @@ OBJS-$(CONFIG_VP3_DECODER) += vp3.o jpegquanttables.o · 761 unmodified lines
762762 OBJS-$(CONFIG_VP5_DECODER) += vp5.o vp56.o vp56data.o vpx_rac.o
763763 OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o \
764764 vp6dsp.o vpx_rac.o
765−OBJS-$(CONFIG_VP7_DECODER) += vp8.o vpx_rac.o
766−OBJS-$(CONFIG_VP8_DECODER) += vp8.o vpx_rac.o
765+OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp8data.o vpx_rac.o
766+OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp8data.o vpx_rac.o
767767 OBJS-$(CONFIG_VP8_CUVID_DECODER) += cuviddec.o
768768 OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER) += mediacodecdec.o
769769 OBJS-$(CONFIG_VP8_QSV_DECODER) += qsvdec.o
libavcodec/vp8data.c+42−0
@@ -0,0 +1,42 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#include "stdint.h"
20+
21+// cat 1 and 2 are defined in vp8data.h
22+static const uint8_t vp8_dct_cat3_prob[] = {
23+ 173, 148, 140, 0
24+};
25+static const uint8_t vp8_dct_cat4_prob[] = {
26+ 176, 155, 140, 135, 0
27+};
28+static const uint8_t vp8_dct_cat5_prob[] = {
29+ 180, 157, 141, 134, 130, 0
30+};
31+static const uint8_t vp8_dct_cat6_prob[] = {
32+ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
33+};
34+
35+// only used for cat3 and above; cat 1 and 2 are referenced directly.
36+const uint8_t *const ff_vp8_dct_cat_prob[] = {
37+ vp8_dct_cat3_prob,
38+ vp8_dct_cat4_prob,
39+ vp8_dct_cat5_prob,
40+ vp8_dct_cat6_prob,
41+};
42+
libavcodec/vp8data.h+1−19
@@ -339,26 +339,8 @@ static const uint8_t vp8_dct_cat1_prob[] = { · 338 unmodified lines
339339 static const uint8_t vp8_dct_cat2_prob[] = {
340340 165, 145, 0
341341 };
342−static const uint8_t vp8_dct_cat3_prob[] = {
343− 173, 148, 140, 0
344−};
345−static const uint8_t vp8_dct_cat4_prob[] = {
346− 176, 155, 140, 135, 0
347−};
348−static const uint8_t vp8_dct_cat5_prob[] = {
349− 180, 157, 141, 134, 130, 0
350−};
351−static const uint8_t vp8_dct_cat6_prob[] = {
352− 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
353−};
354342
355−// only used for cat3 and above; cat 1 and 2 are referenced directly
356−const uint8_t *const ff_vp8_dct_cat_prob[] = {
357− vp8_dct_cat3_prob,
358− vp8_dct_cat4_prob,
359− vp8_dct_cat5_prob,
360− vp8_dct_cat6_prob,
361−};
343+extern const uint8_t *const ff_vp8_dct_cat_prob[];
362344
363345 static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS - 1] = {
364346 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t