Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
15b4f494
Commit
15b4f494
authored
Sep 08, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mss*: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
parent
a339e919
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
46 deletions
+50
-46
mss12.c
libavcodec/mss12.c
+8
-7
mss12.h
libavcodec/mss12.h
+3
-3
mss2.c
libavcodec/mss2.c
+3
-3
mss2dsp.c
libavcodec/mss2dsp.c
+14
-14
mss2dsp.h
libavcodec/mss2dsp.h
+12
-10
mss3.c
libavcodec/mss3.c
+6
-6
mss34dsp.c
libavcodec/mss34dsp.c
+1
-1
mss34dsp.h
libavcodec/mss34dsp.h
+2
-1
mss4.c
libavcodec/mss4.c
+1
-1
No files found.
libavcodec/mss12.c
View file @
15b4f494
...
@@ -197,7 +197,7 @@ static av_always_inline int decode_pixel(ArithCoder *acoder, PixContext *pctx,
...
@@ -197,7 +197,7 @@ static av_always_inline int decode_pixel(ArithCoder *acoder, PixContext *pctx,
}
}
static
int
decode_pixel_in_context
(
ArithCoder
*
acoder
,
PixContext
*
pctx
,
static
int
decode_pixel_in_context
(
ArithCoder
*
acoder
,
PixContext
*
pctx
,
uint8_t
*
src
,
in
t
stride
,
int
x
,
int
y
,
uint8_t
*
src
,
ptrdiff_
t
stride
,
int
x
,
int
y
,
int
has_right
)
int
has_right
)
{
{
uint8_t
neighbours
[
4
];
uint8_t
neighbours
[
4
];
...
@@ -290,8 +290,9 @@ static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
...
@@ -290,8 +290,9 @@ static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
}
}
static
int
decode_region
(
ArithCoder
*
acoder
,
uint8_t
*
dst
,
uint8_t
*
rgb_pic
,
static
int
decode_region
(
ArithCoder
*
acoder
,
uint8_t
*
dst
,
uint8_t
*
rgb_pic
,
int
x
,
int
y
,
int
width
,
int
height
,
int
stride
,
int
x
,
int
y
,
int
width
,
int
height
,
ptrdiff_t
stride
,
int
rgb_stride
,
PixContext
*
pctx
,
const
uint32_t
*
pal
)
ptrdiff_t
rgb_stride
,
PixContext
*
pctx
,
const
uint32_t
*
pal
)
{
{
int
i
,
j
,
p
;
int
i
,
j
,
p
;
uint8_t
*
rgb_dst
=
rgb_pic
+
x
*
3
+
y
*
rgb_stride
;
uint8_t
*
rgb_dst
=
rgb_pic
+
x
*
3
+
y
*
rgb_stride
;
...
@@ -368,8 +369,8 @@ static int motion_compensation(MSS12Context const *c,
...
@@ -368,8 +369,8 @@ static int motion_compensation(MSS12Context const *c,
}
}
static
int
decode_region_masked
(
MSS12Context
const
*
c
,
ArithCoder
*
acoder
,
static
int
decode_region_masked
(
MSS12Context
const
*
c
,
ArithCoder
*
acoder
,
uint8_t
*
dst
,
in
t
stride
,
uint8_t
*
mask
,
uint8_t
*
dst
,
ptrdiff_
t
stride
,
uint8_t
*
mask
,
in
t
mask_stride
,
int
x
,
int
y
,
ptrdiff_
t
mask_stride
,
int
x
,
int
y
,
int
width
,
int
height
,
int
width
,
int
height
,
PixContext
*
pctx
)
PixContext
*
pctx
)
{
{
...
@@ -466,8 +467,8 @@ static int decode_region_intra(SliceContext *sc, ArithCoder *acoder,
...
@@ -466,8 +467,8 @@ static int decode_region_intra(SliceContext *sc, ArithCoder *acoder,
if
(
!
mode
)
{
if
(
!
mode
)
{
int
i
,
j
,
pix
,
rgb_pix
;
int
i
,
j
,
pix
,
rgb_pix
;
int
stride
=
c
->
pal_stride
;
ptrdiff_t
stride
=
c
->
pal_stride
;
int
rgb_stride
=
c
->
rgb_stride
;
ptrdiff_t
rgb_stride
=
c
->
rgb_stride
;
uint8_t
*
dst
=
c
->
pal_pic
+
x
+
y
*
stride
;
uint8_t
*
dst
=
c
->
pal_pic
+
x
+
y
*
stride
;
uint8_t
*
rgb_dst
=
c
->
rgb_pic
+
x
*
3
+
y
*
rgb_stride
;
uint8_t
*
rgb_dst
=
c
->
rgb_pic
+
x
*
3
+
y
*
rgb_stride
;
...
...
libavcodec/mss12.h
View file @
15b4f494
...
@@ -77,12 +77,12 @@ typedef struct MSS12Context {
...
@@ -77,12 +77,12 @@ typedef struct MSS12Context {
uint32_t
pal
[
256
];
uint32_t
pal
[
256
];
uint8_t
*
pal_pic
;
uint8_t
*
pal_pic
;
uint8_t
*
last_pal_pic
;
uint8_t
*
last_pal_pic
;
int
pal_stride
;
ptrdiff_t
pal_stride
;
uint8_t
*
mask
;
uint8_t
*
mask
;
int
mask_stride
;
ptrdiff_t
mask_stride
;
uint8_t
*
rgb_pic
;
uint8_t
*
rgb_pic
;
uint8_t
*
last_rgb_pic
;
uint8_t
*
last_rgb_pic
;
int
rgb_stride
;
ptrdiff_t
rgb_stride
;
int
free_colours
;
int
free_colours
;
int
keyframe
;
int
keyframe
;
int
mvX
,
mvY
;
int
mvX
,
mvY
;
...
...
libavcodec/mss2.c
View file @
15b4f494
...
@@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t *buf, int buf_size)
...
@@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t *buf, int buf_size)
return
1
+
ncol
*
3
;
return
1
+
ncol
*
3
;
}
}
static
int
decode_555
(
GetByteContext
*
gB
,
uint16_t
*
dst
,
in
t
stride
,
static
int
decode_555
(
GetByteContext
*
gB
,
uint16_t
*
dst
,
ptrdiff_
t
stride
,
int
keyframe
,
int
w
,
int
h
)
int
keyframe
,
int
w
,
int
h
)
{
{
int
last_symbol
=
0
,
repeat
=
0
,
prev_avail
=
0
;
int
last_symbol
=
0
,
repeat
=
0
,
prev_avail
=
0
;
...
@@ -232,8 +232,8 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
...
@@ -232,8 +232,8 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
return
0
;
return
0
;
}
}
static
int
decode_rle
(
GetBitContext
*
gb
,
uint8_t
*
pal_dst
,
in
t
pal_stride
,
static
int
decode_rle
(
GetBitContext
*
gb
,
uint8_t
*
pal_dst
,
ptrdiff_
t
pal_stride
,
uint8_t
*
rgb_dst
,
in
t
rgb_stride
,
uint32_t
*
pal
,
uint8_t
*
rgb_dst
,
ptrdiff_
t
rgb_stride
,
uint32_t
*
pal
,
int
keyframe
,
int
kf_slipt
,
int
slice
,
int
w
,
int
h
)
int
keyframe
,
int
kf_slipt
,
int
slice
,
int
w
,
int
h
)
{
{
uint8_t
bits
[
270
]
=
{
0
};
uint8_t
bits
[
270
]
=
{
0
};
...
...
libavcodec/mss2dsp.c
View file @
15b4f494
...
@@ -27,17 +27,17 @@
...
@@ -27,17 +27,17 @@
#include "libavutil/common.h"
#include "libavutil/common.h"
static
av_always_inline
void
mss2_blit_wmv9_template
(
uint8_t
*
dst
,
static
av_always_inline
void
mss2_blit_wmv9_template
(
uint8_t
*
dst
,
in
t
dst_stride
,
ptrdiff_
t
dst_stride
,
int
gray
,
int
gray
,
int
use_mask
,
int
use_mask
,
int
maskcolor
,
int
maskcolor
,
const
uint8_t
*
mask
,
const
uint8_t
*
mask
,
in
t
mask_stride
,
ptrdiff_
t
mask_stride
,
const
uint8_t
*
srcy
,
const
uint8_t
*
srcy
,
in
t
srcy_stride
,
ptrdiff_
t
srcy_stride
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
const
uint8_t
*
srcv
,
in
t
srcuv_stride
,
ptrdiff_
t
srcuv_stride
,
int
w
,
int
h
)
int
w
,
int
h
)
{
{
int
i
,
j
,
k
,
r
=
-
1
;
int
i
,
j
,
k
,
r
=
-
1
;
...
@@ -64,10 +64,10 @@ static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
...
@@ -64,10 +64,10 @@ static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
}
}
}
}
static
void
mss2_blit_wmv9_c
(
uint8_t
*
dst
,
in
t
dst_stride
,
static
void
mss2_blit_wmv9_c
(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
const
uint8_t
*
srcy
,
in
t
srcy_stride
,
const
uint8_t
*
srcy
,
ptrdiff_
t
srcy_stride
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
in
t
srcuv_stride
,
int
w
,
int
h
)
ptrdiff_
t
srcuv_stride
,
int
w
,
int
h
)
{
{
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
0
,
0
,
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
0
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
0
,
...
@@ -76,12 +76,12 @@ static void mss2_blit_wmv9_c(uint8_t *dst, int dst_stride,
...
@@ -76,12 +76,12 @@ static void mss2_blit_wmv9_c(uint8_t *dst, int dst_stride,
w
,
h
);
w
,
h
);
}
}
static
void
mss2_blit_wmv9_masked_c
(
uint8_t
*
dst
,
in
t
dst_stride
,
static
void
mss2_blit_wmv9_masked_c
(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
int
maskcolor
,
const
uint8_t
*
mask
,
int
maskcolor
,
const
uint8_t
*
mask
,
in
t
mask_stride
,
ptrdiff_
t
mask_stride
,
const
uint8_t
*
srcy
,
in
t
srcy_stride
,
const
uint8_t
*
srcy
,
ptrdiff_
t
srcy_stride
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
in
t
srcuv_stride
,
int
w
,
int
h
)
ptrdiff_
t
srcuv_stride
,
int
w
,
int
h
)
{
{
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
0
,
1
,
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
0
,
1
,
maskcolor
,
mask
,
mask_stride
,
maskcolor
,
mask
,
mask_stride
,
...
@@ -90,9 +90,9 @@ static void mss2_blit_wmv9_masked_c(uint8_t *dst, int dst_stride,
...
@@ -90,9 +90,9 @@ static void mss2_blit_wmv9_masked_c(uint8_t *dst, int dst_stride,
w
,
h
);
w
,
h
);
}
}
static
void
mss2_gray_fill_masked_c
(
uint8_t
*
dst
,
in
t
dst_stride
,
static
void
mss2_gray_fill_masked_c
(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
int
maskcolor
,
const
uint8_t
*
mask
,
int
maskcolor
,
const
uint8_t
*
mask
,
in
t
mask_stride
,
int
w
,
int
h
)
ptrdiff_
t
mask_stride
,
int
w
,
int
h
)
{
{
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
1
,
1
,
mss2_blit_wmv9_template
(
dst
,
dst_stride
,
1
,
1
,
maskcolor
,
mask
,
mask_stride
,
maskcolor
,
mask
,
mask_stride
,
...
@@ -101,7 +101,7 @@ static void mss2_gray_fill_masked_c(uint8_t *dst, int dst_stride,
...
@@ -101,7 +101,7 @@ static void mss2_gray_fill_masked_c(uint8_t *dst, int dst_stride,
w
,
h
);
w
,
h
);
}
}
static
void
upsample_plane_c
(
uint8_t
*
plane
,
in
t
plane_stride
,
int
w
,
int
h
)
static
void
upsample_plane_c
(
uint8_t
*
plane
,
ptrdiff_
t
plane_stride
,
int
w
,
int
h
)
{
{
uint8_t
*
src1
,
*
src2
,
*
dst1
,
*
dst2
,
*
p
,
a
,
b
;
uint8_t
*
src1
,
*
src2
,
*
dst1
,
*
dst2
,
*
p
,
a
,
b
;
int
i
,
j
;
int
i
,
j
;
...
...
libavcodec/mss2dsp.h
View file @
15b4f494
...
@@ -26,23 +26,25 @@
...
@@ -26,23 +26,25 @@
#ifndef AVCODEC_MSS2DSP_H
#ifndef AVCODEC_MSS2DSP_H
#define AVCODEC_MSS2DSP_H
#define AVCODEC_MSS2DSP_H
#include <stddef.h>
#include <stdint.h>
#include <stdint.h>
typedef
struct
MSS2DSPContext
{
typedef
struct
MSS2DSPContext
{
void
(
*
mss2_blit_wmv9
)(
uint8_t
*
dst
,
in
t
dst_stride
,
void
(
*
mss2_blit_wmv9
)(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
const
uint8_t
*
srcy
,
in
t
srcy_stride
,
const
uint8_t
*
srcy
,
ptrdiff_
t
srcy_stride
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
in
t
srcuv_stride
,
int
w
,
int
h
);
ptrdiff_
t
srcuv_stride
,
int
w
,
int
h
);
void
(
*
mss2_blit_wmv9_masked
)(
uint8_t
*
dst
,
in
t
dst_stride
,
void
(
*
mss2_blit_wmv9_masked
)(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
int
maskcolor
,
const
uint8_t
*
mask
,
int
maskcolor
,
const
uint8_t
*
mask
,
in
t
mask_stride
,
ptrdiff_
t
mask_stride
,
const
uint8_t
*
srcy
,
in
t
srcy_stride
,
const
uint8_t
*
srcy
,
ptrdiff_
t
srcy_stride
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
const
uint8_t
*
srcu
,
const
uint8_t
*
srcv
,
in
t
srcuv_stride
,
int
w
,
int
h
);
ptrdiff_
t
srcuv_stride
,
int
w
,
int
h
);
void
(
*
mss2_gray_fill_masked
)(
uint8_t
*
dst
,
in
t
dst_stride
,
void
(
*
mss2_gray_fill_masked
)(
uint8_t
*
dst
,
ptrdiff_
t
dst_stride
,
int
maskcolor
,
const
uint8_t
*
mask
,
int
maskcolor
,
const
uint8_t
*
mask
,
int
mask_stride
,
int
w
,
int
h
);
ptrdiff_t
mask_stride
,
int
w
,
int
h
);
void
(
*
upsample_plane
)(
uint8_t
*
plane
,
int
plane_stride
,
int
w
,
int
h
);
void
(
*
upsample_plane
)(
uint8_t
*
plane
,
ptrdiff_t
plane_stride
,
int
w
,
int
h
);
}
MSS2DSPContext
;
}
MSS2DSPContext
;
void
ff_mss2dsp_init
(
MSS2DSPContext
*
dsp
);
void
ff_mss2dsp_init
(
MSS2DSPContext
*
dsp
);
...
...
libavcodec/mss3.c
View file @
15b4f494
...
@@ -91,7 +91,7 @@ typedef struct ImageBlockCoder {
...
@@ -91,7 +91,7 @@ typedef struct ImageBlockCoder {
typedef
struct
DCTBlockCoder
{
typedef
struct
DCTBlockCoder
{
int
*
prev_dc
;
int
*
prev_dc
;
int
prev_dc_stride
;
ptrdiff_t
prev_dc_stride
;
int
prev_dc_height
;
int
prev_dc_height
;
int
quality
;
int
quality
;
uint16_t
qmat
[
64
];
uint16_t
qmat
[
64
];
...
@@ -450,7 +450,7 @@ static int decode_coeff(RangeCoder *c, Model *m)
...
@@ -450,7 +450,7 @@ static int decode_coeff(RangeCoder *c, Model *m)
}
}
static
void
decode_fill_block
(
RangeCoder
*
c
,
FillBlockCoder
*
fc
,
static
void
decode_fill_block
(
RangeCoder
*
c
,
FillBlockCoder
*
fc
,
uint8_t
*
dst
,
in
t
stride
,
int
block_size
)
uint8_t
*
dst
,
ptrdiff_
t
stride
,
int
block_size
)
{
{
int
i
;
int
i
;
...
@@ -461,7 +461,7 @@ static void decode_fill_block(RangeCoder *c, FillBlockCoder *fc,
...
@@ -461,7 +461,7 @@ static void decode_fill_block(RangeCoder *c, FillBlockCoder *fc,
}
}
static
void
decode_image_block
(
RangeCoder
*
c
,
ImageBlockCoder
*
ic
,
static
void
decode_image_block
(
RangeCoder
*
c
,
ImageBlockCoder
*
ic
,
uint8_t
*
dst
,
in
t
stride
,
int
block_size
)
uint8_t
*
dst
,
ptrdiff_
t
stride
,
int
block_size
)
{
{
int
i
,
j
;
int
i
,
j
;
int
vec_size
;
int
vec_size
;
...
@@ -557,7 +557,7 @@ static int decode_dct(RangeCoder *c, DCTBlockCoder *bc, int *block,
...
@@ -557,7 +557,7 @@ static int decode_dct(RangeCoder *c, DCTBlockCoder *bc, int *block,
}
}
static
void
decode_dct_block
(
RangeCoder
*
c
,
DCTBlockCoder
*
bc
,
static
void
decode_dct_block
(
RangeCoder
*
c
,
DCTBlockCoder
*
bc
,
uint8_t
*
dst
,
in
t
stride
,
int
block_size
,
uint8_t
*
dst
,
ptrdiff_
t
stride
,
int
block_size
,
int
*
block
,
int
mb_x
,
int
mb_y
)
int
*
block
,
int
mb_x
,
int
mb_y
)
{
{
int
i
,
j
;
int
i
,
j
;
...
@@ -580,8 +580,8 @@ static void decode_dct_block(RangeCoder *c, DCTBlockCoder *bc,
...
@@ -580,8 +580,8 @@ static void decode_dct_block(RangeCoder *c, DCTBlockCoder *bc,
}
}
static
void
decode_haar_block
(
RangeCoder
*
c
,
HaarBlockCoder
*
hc
,
static
void
decode_haar_block
(
RangeCoder
*
c
,
HaarBlockCoder
*
hc
,
uint8_t
*
dst
,
int
stride
,
int
block_siz
e
,
uint8_t
*
dst
,
ptrdiff_t
strid
e
,
int
*
block
)
int
block_size
,
int
*
block
)
{
{
const
int
hsize
=
block_size
>>
1
;
const
int
hsize
=
block_size
>>
1
;
int
A
,
B
,
C
,
D
,
t1
,
t2
,
t3
,
t4
;
int
A
,
B
,
C
,
D
,
t1
,
t2
,
t3
,
t4
;
...
...
libavcodec/mss34dsp.c
View file @
15b4f494
...
@@ -87,7 +87,7 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
...
@@ -87,7 +87,7 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
#define SOP_ROW(a) ((a) << 16) + 0x2000
#define SOP_ROW(a) ((a) << 16) + 0x2000
#define SOP_COL(a) ((a + 32) << 16)
#define SOP_COL(a) ((a + 32) << 16)
void
ff_mss34_dct_put
(
uint8_t
*
dst
,
in
t
stride
,
int
*
block
)
void
ff_mss34_dct_put
(
uint8_t
*
dst
,
ptrdiff_
t
stride
,
int
*
block
)
{
{
int
i
,
j
;
int
i
,
j
;
int
*
ptr
;
int
*
ptr
;
...
...
libavcodec/mss34dsp.h
View file @
15b4f494
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#ifndef AVCODEC_MSS34DSP_H
#ifndef AVCODEC_MSS34DSP_H
#define AVCODEC_MSS34DSP_H
#define AVCODEC_MSS34DSP_H
#include <stddef.h>
#include <stdint.h>
#include <stdint.h>
/**
/**
...
@@ -40,6 +41,6 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma);
...
@@ -40,6 +41,6 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma);
* @param stride output plane stride
* @param stride output plane stride
* @param block block to transform and output
* @param block block to transform and output
*/
*/
void
ff_mss34_dct_put
(
uint8_t
*
dst
,
in
t
stride
,
int
*
block
);
void
ff_mss34_dct_put
(
uint8_t
*
dst
,
ptrdiff_
t
stride
,
int
*
block
);
#endif
/* AVCODEC_MSS34DSP_H */
#endif
/* AVCODEC_MSS34DSP_H */
libavcodec/mss4.c
View file @
15b4f494
...
@@ -136,7 +136,7 @@ typedef struct MSS4Context {
...
@@ -136,7 +136,7 @@ typedef struct MSS4Context {
uint16_t
quant_mat
[
2
][
64
];
uint16_t
quant_mat
[
2
][
64
];
int
*
prev_dc
[
3
];
int
*
prev_dc
[
3
];
int
dc_stride
[
3
];
ptrdiff_t
dc_stride
[
3
];
int
dc_cache
[
4
][
4
];
int
dc_cache
[
4
][
4
];
int
prev_vec
[
3
][
4
];
int
prev_vec
[
3
][
4
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment