Skip to content

Commit d349835

Browse files
committed
[Backport] Fix libvpx build
Merges Debian patch that fixes the compiler error: 'invalid use of array with unspecified bounds' Change-Id: If3ff385a78ccb63d8df6ed2e1c9944f20d616d24 Reviewed-by: Michael Brüning <[email protected]>
1 parent 19e3bbd commit d349835

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

chromium/third_party/libvpx/source/libvpx/vp8/common/treecoder.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
static void tree2tok(
2020
struct vp8_token_struct *const p,
21-
vp8_tree t,
21+
vp8_tree_p t,
2222
int i,
2323
int v,
2424
int L
@@ -42,12 +42,12 @@ static void tree2tok(
4242
while (++v & 1);
4343
}
4444

45-
void vp8_tokens_from_tree(struct vp8_token_struct *p, vp8_tree t)
45+
void vp8_tokens_from_tree(struct vp8_token_struct *p, vp8_tree_p t)
4646
{
4747
tree2tok(p, t, 0, 0, 0);
4848
}
4949

50-
void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree t,
50+
void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree_p t,
5151
int offset)
5252
{
5353
tree2tok(p - offset, t, 0, 0, 0);
@@ -56,7 +56,7 @@ void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree t,
5656
static void branch_counts(
5757
int n, /* n = size of alphabet */
5858
vp8_token tok [ /* n */ ],
59-
vp8_tree tree,
59+
vp8_tree_p tree,
6060
unsigned int branch_ct [ /* n-1 */ ] [2],
6161
const unsigned int num_events[ /* n */ ]
6262
)
@@ -109,7 +109,7 @@ static void branch_counts(
109109
void vp8_tree_probs_from_distribution(
110110
int n, /* n = size of alphabet */
111111
vp8_token tok [ /* n */ ],
112-
vp8_tree tree,
112+
vp8_tree_p tree,
113113
vp8_prob probs [ /* n-1 */ ],
114114
unsigned int branch_ct [ /* n-1 */ ] [2],
115115
const unsigned int num_events[ /* n */ ],

chromium/third_party/libvpx/source/libvpx/vp8/common/treecoder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ typedef const struct vp8_token_struct
5757

5858
/* Construct encoding array from tree. */
5959

60-
void vp8_tokens_from_tree(struct vp8_token_struct *, vp8_tree);
61-
void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree,
60+
void vp8_tokens_from_tree(struct vp8_token_struct *, vp8_tree_p);
61+
void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree_p,
6262
int offset);
6363

6464

@@ -70,7 +70,7 @@ void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree,
7070
void vp8_tree_probs_from_distribution(
7171
int n, /* n = size of alphabet */
7272
vp8_token tok [ /* n */ ],
73-
vp8_tree tree,
73+
vp8_tree_p tree,
7474
vp8_prob probs [ /* n-1 */ ],
7575
unsigned int branch_ct [ /* n-1 */ ] [2],
7676
const unsigned int num_events[ /* n */ ],
@@ -83,7 +83,7 @@ void vp8_tree_probs_from_distribution(
8383
void vp8bc_tree_probs_from_distribution(
8484
int n, /* n = size of alphabet */
8585
vp8_token tok [ /* n */ ],
86-
vp8_tree tree,
86+
vp8_tree_p tree,
8787
vp8_prob probs [ /* n-1 */ ],
8888
unsigned int branch_ct [ /* n-1 */ ] [2],
8989
const unsigned int num_events[ /* n */ ],

chromium/third_party/libvpx/source/libvpx/vp8/decoder/treereader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef BOOL_DECODER vp8_reader;
3030

3131
static int vp8_treed_read(
3232
vp8_reader *const r, /* !!! must return a 0 or 1 !!! */
33-
vp8_tree t,
33+
vp8_tree_p t,
3434
const vp8_prob *const p
3535
)
3636
{

chromium/third_party/libvpx/source/libvpx/vp8/encoder/bitstream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void update_mode(
6464
vp8_writer *const w,
6565
int n,
6666
vp8_token tok [/* n */],
67-
vp8_tree tree,
67+
vp8_tree_p tree,
6868
vp8_prob Pnew [/* n-1 */],
6969
vp8_prob Pcur [/* n-1 */],
7070
unsigned int bct [/* n-1 */] [2],

chromium/third_party/libvpx/source/libvpx/vp8/encoder/treewriter.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
static void cost(
1515
int *const C,
16-
vp8_tree T,
16+
vp8_tree_p T,
1717
const vp8_prob *const P,
1818
int i,
1919
int c
@@ -33,11 +33,11 @@ static void cost(
3333
}
3434
while (++i & 1);
3535
}
36-
void vp8_cost_tokens(int *c, const vp8_prob *p, vp8_tree t)
36+
void vp8_cost_tokens(int *c, const vp8_prob *p, vp8_tree_p t)
3737
{
3838
cost(c, t, p, 0, 0);
3939
}
40-
void vp8_cost_tokens2(int *c, const vp8_prob *p, vp8_tree t,int start)
40+
void vp8_cost_tokens2(int *c, const vp8_prob *p, vp8_tree_p t,int start)
4141
{
4242
cost(c, t, p, start, 0);
4343
}

chromium/third_party/libvpx/source/libvpx/vp8/encoder/treewriter.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p)
6060
static void vp8_treed_write
6161
(
6262
vp8_writer *const w,
63-
vp8_tree t,
63+
vp8_tree_p t,
6464
const vp8_prob *const p,
6565
int v,
6666
int n /* number of bits in v, assumed nonzero */
@@ -79,7 +79,7 @@ static void vp8_treed_write
7979
static void vp8_write_token
8080
(
8181
vp8_writer *const w,
82-
vp8_tree t,
82+
vp8_tree_p t,
8383
const vp8_prob *const p,
8484
vp8_token *const x
8585
)
@@ -88,7 +88,7 @@ static void vp8_write_token
8888
}
8989

9090
static int vp8_treed_cost(
91-
vp8_tree t,
91+
vp8_tree_p t,
9292
const vp8_prob *const p,
9393
int v,
9494
int n /* number of bits in v, assumed nonzero */
@@ -109,7 +109,7 @@ static int vp8_treed_cost(
109109
}
110110
static int vp8_cost_token
111111
(
112-
vp8_tree t,
112+
vp8_tree_p t,
113113
const vp8_prob *const p,
114114
vp8_token *const x
115115
)
@@ -120,11 +120,11 @@ static int vp8_cost_token
120120
/* Fill array of costs for all possible token values. */
121121

122122
void vp8_cost_tokens(
123-
int *Costs, const vp8_prob *, vp8_tree
123+
int *Costs, const vp8_prob *, vp8_tree_p
124124
);
125125

126126
void vp8_cost_tokens2(
127-
int *Costs, const vp8_prob *, vp8_tree, int
127+
int *Costs, const vp8_prob *, vp8_tree_p, int
128128
);
129129

130130
#ifdef __cplusplus

chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_prob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef int8_t vp9_tree_index;
4040
Index > 0 means need another bit, specification at index.
4141
Nonnegative indices are always even; processing begins at node 0. */
4242

43-
typedef const vp9_tree_index vp9_tree[];
43+
typedef const vp9_tree_index vp9_tree[], *vp9_tree_p;;
4444

4545
static INLINE vp9_prob clip_prob(int p) {
4646
return (p > 255) ? 255 : (p < 1) ? 1 : p;

chromium/third_party/libvpx/source/libvpx/vp9/encoder/vp9_cost.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const unsigned int vp9_prob_cost[256] = {
3434
22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6,
3535
4, 3, 1, 1};
3636

37-
static void cost(int *costs, vp9_tree tree, const vp9_prob *probs,
37+
static void cost(int *costs, vp9_tree_p tree, const vp9_prob *probs,
3838
int i, int c) {
3939
const vp9_prob prob = probs[i / 2];
4040
int b;
@@ -50,11 +50,11 @@ static void cost(int *costs, vp9_tree tree, const vp9_prob *probs,
5050
}
5151
}
5252

53-
void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree) {
53+
void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree_p tree) {
5454
cost(costs, tree, probs, 0, 0);
5555
}
5656

57-
void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree) {
57+
void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree_p tree) {
5858
assert(tree[0] <= 0 && tree[1] > 0);
5959

6060
costs[-tree[0]] = vp9_cost_bit(probs[0], 0);

chromium/third_party/libvpx/source/libvpx/vp9/encoder/vp9_cost.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static INLINE unsigned int cost_branch256(const unsigned int ct[2],
3131
return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p);
3232
}
3333

34-
static INLINE int treed_cost(vp9_tree tree, const vp9_prob *probs,
34+
static INLINE int treed_cost(vp9_tree_p tree, const vp9_prob *probs,
3535
int bits, int len) {
3636
int cost = 0;
3737
vp9_tree_index i = 0;
@@ -45,8 +45,8 @@ static INLINE int treed_cost(vp9_tree tree, const vp9_prob *probs,
4545
return cost;
4646
}
4747

48-
void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree);
49-
void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree);
48+
void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree_p tree);
49+
void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree_p tree);
5050

5151
#ifdef __cplusplus
5252
} // extern "C"

chromium/third_party/libvpx/source/libvpx/vp9/encoder/vp9_treewriter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void vp9_tokens_from_tree(struct vp9_token *tokens,
3131
tree2tok(tokens, tree, 0, 0, 0);
3232
}
3333

34-
static unsigned int convert_distribution(unsigned int i, vp9_tree tree,
34+
static unsigned int convert_distribution(unsigned int i, vp9_tree_p tree,
3535
unsigned int branch_ct[][2],
3636
const unsigned int num_events[]) {
3737
unsigned int left, right;
@@ -51,7 +51,7 @@ static unsigned int convert_distribution(unsigned int i, vp9_tree tree,
5151
return left + right;
5252
}
5353

54-
void vp9_tree_probs_from_distribution(vp9_tree tree,
54+
void vp9_tree_probs_from_distribution(vp9_tree_p tree,
5555
unsigned int branch_ct[/* n-1 */][2],
5656
const unsigned int num_events[/* n */]) {
5757
convert_distribution(0, tree, branch_ct, num_events);

chromium/third_party/libvpx/source/libvpx/vp9/encoder/vp9_treewriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
extern "C" {
1818
#endif
1919

20-
void vp9_tree_probs_from_distribution(vp9_tree tree,
20+
void vp9_tree_probs_from_distribution(vp9_tree_p tree,
2121
unsigned int branch_ct[ /* n - 1 */ ][2],
2222
const unsigned int num_events[ /* n */ ]);
2323

0 commit comments

Comments
 (0)