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
cd417d94
Commit
cd417d94
authored
Jul 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegdec: fix width for non chroma in rescaling
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4e09300f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mjpegdec.c
libavcodec/mjpegdec.c
+6
-4
No files found.
libavcodec/mjpegdec.c
View file @
cd417d94
...
@@ -2082,10 +2082,11 @@ the_end:
...
@@ -2082,10 +2082,11 @@ the_end:
avcodec_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
hshift
,
&
vshift
);
avcodec_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
hshift
,
&
vshift
);
for
(
p
=
1
;
p
<
4
;
p
++
)
{
for
(
p
=
1
;
p
<
4
;
p
++
)
{
uint8_t
*
line
=
s
->
picture_ptr
->
data
[
p
];
uint8_t
*
line
=
s
->
picture_ptr
->
data
[
p
];
int
w
;
int
w
=
s
->
width
;
if
(
!
(
s
->
upscale_h
&
(
1
<<
p
)))
if
(
!
(
s
->
upscale_h
&
(
1
<<
p
)))
continue
;
continue
;
w
=
s
->
width
>>
hshift
;
if
(
p
==
1
||
p
==
2
)
w
>>=
hshift
;
for
(
i
=
0
;
i
<
s
->
chroma_height
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
chroma_height
;
i
++
)
{
for
(
index
=
w
-
1
;
index
;
index
--
)
for
(
index
=
w
-
1
;
index
;
index
--
)
line
[
index
]
=
(
line
[
index
/
2
]
+
line
[(
index
+
1
)
/
2
])
>>
1
;
line
[
index
]
=
(
line
[
index
/
2
]
+
line
[(
index
+
1
)
/
2
])
>>
1
;
...
@@ -2105,10 +2106,11 @@ the_end:
...
@@ -2105,10 +2106,11 @@ the_end:
avcodec_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
hshift
,
&
vshift
);
avcodec_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
hshift
,
&
vshift
);
for
(
p
=
1
;
p
<
4
;
p
++
)
{
for
(
p
=
1
;
p
<
4
;
p
++
)
{
uint8_t
*
dst
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
s
->
height
-
1
)
*
s
->
linesize
[
p
]];
uint8_t
*
dst
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
s
->
height
-
1
)
*
s
->
linesize
[
p
]];
int
w
;
int
w
=
s
->
width
;
if
(
!
(
s
->
upscale_v
&
(
1
<<
p
)))
if
(
!
(
s
->
upscale_v
&
(
1
<<
p
)))
continue
;
continue
;
w
=
s
->
width
>>
hshift
;
if
(
p
==
1
||
p
==
2
)
w
>>=
hshift
;
for
(
i
=
s
->
height
-
1
;
i
;
i
--
)
{
for
(
i
=
s
->
height
-
1
;
i
;
i
--
)
{
uint8_t
*
src1
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[
i
/
2
*
s
->
linesize
[
p
]];
uint8_t
*
src1
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[
i
/
2
*
s
->
linesize
[
p
]];
uint8_t
*
src2
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
i
+
1
)
/
2
*
s
->
linesize
[
p
]];
uint8_t
*
src2
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
i
+
1
)
/
2
*
s
->
linesize
[
p
]];
...
...
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