Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
6d93e7d1
Commit
6d93e7d1
authored
Mar 03, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/scpr: fix top left prediction for special case when x is 0 for keyframes
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
16abc10b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
scpr.c
libavcodec/scpr.c
+25
-10
No files found.
libavcodec/scpr.c
View file @
6d93e7d1
...
@@ -295,7 +295,8 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
...
@@ -295,7 +295,8 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
SCPRContext
*
s
=
avctx
->
priv_data
;
SCPRContext
*
s
=
avctx
->
priv_data
;
GetByteContext
*
gb
=
&
s
->
gb
;
GetByteContext
*
gb
=
&
s
->
gb
;
int
cx
=
0
,
cx1
=
0
,
k
=
0
,
clr
=
0
;
int
cx
=
0
,
cx1
=
0
,
k
=
0
,
clr
=
0
;
int
run
,
r
,
g
,
b
,
off
,
y
=
0
,
x
=
0
,
ret
;
int
run
,
r
,
g
,
b
,
off
,
y
=
0
,
x
=
0
,
z
,
ret
;
unsigned
backstep
=
linesize
-
avctx
->
width
;
const
int
cxshift
=
s
->
cxshift
;
const
int
cxshift
=
s
->
cxshift
;
unsigned
lx
,
ly
,
ptype
;
unsigned
lx
,
ly
,
ptype
;
...
@@ -424,18 +425,25 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
...
@@ -424,18 +425,25 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
while
(
run
--
>
0
)
{
while
(
run
--
>
0
)
{
uint8_t
*
odst
=
(
uint8_t
*
)
dst
;
uint8_t
*
odst
=
(
uint8_t
*
)
dst
;
if
(
y
<
1
||
y
>=
avctx
->
height
)
if
(
y
<
1
||
y
>=
avctx
->
height
||
(
y
==
1
&&
x
==
0
))
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
if
(
x
==
0
)
{
z
=
backstep
;
}
else
{
z
=
0
;
}
r
=
odst
[(
ly
*
linesize
+
lx
)
*
4
]
+
r
=
odst
[(
ly
*
linesize
+
lx
)
*
4
]
+
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
+
4
]
-
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
+
4
]
-
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
];
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
];
g
=
odst
[(
ly
*
linesize
+
lx
)
*
4
+
1
]
+
g
=
odst
[(
ly
*
linesize
+
lx
)
*
4
+
1
]
+
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
+
5
]
-
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
+
5
]
-
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
+
1
];
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
+
1
];
b
=
odst
[(
ly
*
linesize
+
lx
)
*
4
+
2
]
+
b
=
odst
[(
ly
*
linesize
+
lx
)
*
4
+
2
]
+
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
+
6
]
-
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
+
6
]
-
odst
[((
y
*
linesize
+
x
)
+
off
)
*
4
+
2
];
odst
[((
y
*
linesize
+
x
)
+
off
-
z
)
*
4
+
2
];
clr
=
((
b
&
0xFF
)
<<
16
)
+
((
g
&
0xFF
)
<<
8
)
+
(
r
&
0xFF
);
clr
=
((
b
&
0xFF
)
<<
16
)
+
((
g
&
0xFF
)
<<
8
)
+
(
r
&
0xFF
);
dst
[
y
*
linesize
+
x
]
=
clr
;
dst
[
y
*
linesize
+
x
]
=
clr
;
lx
=
x
;
lx
=
x
;
...
@@ -449,10 +457,17 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
...
@@ -449,10 +457,17 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
break
;
break
;
case
5
:
case
5
:
while
(
run
--
>
0
)
{
while
(
run
--
>
0
)
{
if
(
y
<
1
||
y
>=
avctx
->
height
)
if
(
y
<
1
||
y
>=
avctx
->
height
||
(
y
==
1
&&
x
==
0
))
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
clr
=
dst
[
y
*
linesize
+
x
+
off
];
if
(
x
==
0
)
{
z
=
backstep
;
}
else
{
z
=
0
;
}
clr
=
dst
[
y
*
linesize
+
x
+
off
-
z
];
dst
[
y
*
linesize
+
x
]
=
clr
;
dst
[
y
*
linesize
+
x
]
=
clr
;
lx
=
x
;
lx
=
x
;
ly
=
y
;
ly
=
y
;
...
...
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