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
260de8a2
Commit
260de8a2
authored
Sep 18, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/sheervideo: fix Y prediction in decode_ybr(i) for older formats
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
6cbd47bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
sheervideo.c
libavcodec/sheervideo.c
+6
-2
No files found.
libavcodec/sheervideo.c
View file @
260de8a2
...
...
@@ -31,6 +31,7 @@
typedef
struct
SheerVideoContext
{
unsigned
format
;
int
alt
;
VLC
vlc
[
2
];
void
(
*
decode_frame
)(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
);
}
SheerVideoContext
;
...
...
@@ -2038,7 +2039,7 @@ static void decode_ybri(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
dst_v
[
x
]
=
get_bits
(
gb
,
8
);
}
}
else
{
int
pred
[
4
]
=
{
125
,
-
128
,
-
128
,
-
128
};
int
pred
[
4
]
=
{
s
->
alt
?
125
:
-
146
,
-
128
,
-
128
,
-
128
};
for
(
x
=
0
;
x
<
avctx
->
width
;
x
++
)
{
int
y
,
u
,
v
;
...
...
@@ -2106,7 +2107,7 @@ static void decode_ybr(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
dst_v
[
x
]
=
get_bits
(
gb
,
8
);
}
}
else
{
int
pred
[
4
]
=
{
125
,
-
128
,
-
128
,
-
128
};
int
pred
[
4
]
=
{
s
->
alt
?
125
:
-
146
,
-
128
,
-
128
,
-
128
};
for
(
x
=
0
;
x
<
avctx
->
width
;
x
++
)
{
int
y
,
u
,
v
;
...
...
@@ -2887,6 +2888,7 @@ static int decode_frame(AVCodecContext *avctx,
AV_RL32
(
avpkt
->
data
)
!=
MKTAG
(
'Z'
,
'w'
,
'a'
,
'k'
))
return
AVERROR_INVALIDDATA
;
s
->
alt
=
0
;
format
=
AV_RL32
(
avpkt
->
data
+
16
);
switch
(
format
)
{
case
MKTAG
(
' '
,
'R'
,
'G'
,
'B'
):
...
...
@@ -2972,6 +2974,7 @@ static int decode_frame(AVCodecContext *avctx,
}
break
;
case
MKTAG
(
' '
,
'Y'
,
'B'
,
'R'
):
s
->
alt
=
1
;
case
MKTAG
(
' '
,
'Y'
,
'b'
,
'R'
):
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV444P
;
s
->
decode_frame
=
decode_ybr
;
...
...
@@ -2981,6 +2984,7 @@ static int decode_frame(AVCodecContext *avctx,
}
break
;
case
MKTAG
(
' '
,
'y'
,
'B'
,
'R'
):
s
->
alt
=
1
;
case
MKTAG
(
' '
,
'y'
,
'b'
,
'R'
):
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV444P
;
s
->
decode_frame
=
decode_ybri
;
...
...
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