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
b1435626
Commit
b1435626
authored
Jan 07, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ljpegdec: Support MCU in ljpeg_decode_yuv_scan()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
cd2a27e1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
mjpegdec.c
libavcodec/mjpegdec.c
+15
-8
No files found.
libavcodec/mjpegdec.c
View file @
b1435626
...
@@ -765,6 +765,8 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
...
@@ -765,6 +765,8 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
int
i
,
mb_x
,
mb_y
;
int
i
,
mb_x
,
mb_y
;
const
int
nb_components
=
s
->
nb_components
;
const
int
nb_components
=
s
->
nb_components
;
int
bits
=
(
s
->
bits
+
7
)
&~
7
;
int
bits
=
(
s
->
bits
+
7
)
&~
7
;
int
resync_mb_y
=
0
;
int
resync_mb_x
=
0
;
point_transform
+=
bits
-
s
->
bits
;
point_transform
+=
bits
-
s
->
bits
;
...
@@ -772,10 +774,15 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
...
@@ -772,10 +774,15 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
for
(
mb_y
=
0
;
mb_y
<
s
->
mb_height
;
mb_y
++
)
{
for
(
mb_y
=
0
;
mb_y
<
s
->
mb_height
;
mb_y
++
)
{
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
if
(
s
->
restart_interval
&&
!
s
->
restart_count
)
if
(
s
->
restart_interval
&&
!
s
->
restart_count
)
{
s
->
restart_count
=
s
->
restart_interval
;
s
->
restart_count
=
s
->
restart_interval
;
resync_mb_x
=
mb_x
;
resync_mb_y
=
mb_y
;
}
if
(
mb_x
==
0
||
mb_y
==
0
||
s
->
interlaced
){
if
(
!
mb_x
||
mb_y
==
resync_mb_y
||
mb_y
==
resync_mb_y
+
1
&&
mb_x
<
resync_mb_x
||
s
->
interlaced
){
int
toprow
=
mb_y
==
resync_mb_y
||
mb_y
==
resync_mb_y
+
1
&&
mb_x
<
resync_mb_x
;
int
leftcol
=
!
mb_x
||
mb_y
==
resync_mb_y
&&
mb_x
==
resync_mb_x
;
for
(
i
=
0
;
i
<
nb_components
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_components
;
i
++
)
{
uint8_t
*
ptr
;
uint8_t
*
ptr
;
uint16_t
*
ptr16
;
uint16_t
*
ptr16
;
...
@@ -798,14 +805,14 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
...
@@ -798,14 +805,14 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
return
-
1
;
return
-
1
;
if
(
bits
<=
8
){
if
(
bits
<=
8
){
ptr
=
s
->
picture
.
data
[
c
]
+
(
linesize
*
(
v
*
mb_y
+
y
))
+
(
h
*
mb_x
+
x
);
//FIXME optimize this crap
ptr
=
s
->
picture
.
data
[
c
]
+
(
linesize
*
(
v
*
mb_y
+
y
))
+
(
h
*
mb_x
+
x
);
//FIXME optimize this crap
if
(
y
==
0
&&
mb_y
==
0
){
if
(
y
==
0
&&
toprow
){
if
(
x
==
0
&&
mb_x
==
0
){
if
(
x
==
0
&&
leftcol
){
pred
=
1
<<
(
bits
-
1
);
pred
=
1
<<
(
bits
-
1
);
}
else
{
}
else
{
pred
=
ptr
[
-
1
];
pred
=
ptr
[
-
1
];
}
}
}
else
{
}
else
{
if
(
x
==
0
&&
mb_x
==
0
){
if
(
x
==
0
&&
leftcol
){
pred
=
ptr
[
-
linesize
];
pred
=
ptr
[
-
linesize
];
}
else
{
}
else
{
PREDICT
(
pred
,
ptr
[
-
linesize
-
1
],
ptr
[
-
linesize
],
ptr
[
-
1
],
predictor
);
PREDICT
(
pred
,
ptr
[
-
linesize
-
1
],
ptr
[
-
linesize
],
ptr
[
-
1
],
predictor
);
...
@@ -818,14 +825,14 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
...
@@ -818,14 +825,14 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point
*
ptr
=
pred
+
(
dc
<<
point_transform
);
*
ptr
=
pred
+
(
dc
<<
point_transform
);
}
else
{
}
else
{
ptr16
=
s
->
picture
.
data
[
c
]
+
2
*
(
linesize
*
(
v
*
mb_y
+
y
))
+
2
*
(
h
*
mb_x
+
x
);
//FIXME optimize this crap
ptr16
=
s
->
picture
.
data
[
c
]
+
2
*
(
linesize
*
(
v
*
mb_y
+
y
))
+
2
*
(
h
*
mb_x
+
x
);
//FIXME optimize this crap
if
(
y
==
0
&&
mb_y
==
0
){
if
(
y
==
0
&&
toprow
){
if
(
x
==
0
&&
mb_x
==
0
){
if
(
x
==
0
&&
leftcol
){
pred
=
1
<<
(
bits
-
1
);
pred
=
1
<<
(
bits
-
1
);
}
else
{
}
else
{
pred
=
ptr16
[
-
1
];
pred
=
ptr16
[
-
1
];
}
}
}
else
{
}
else
{
if
(
x
==
0
&&
mb_x
==
0
){
if
(
x
==
0
&&
leftcol
){
pred
=
ptr16
[
-
linesize
];
pred
=
ptr16
[
-
linesize
];
}
else
{
}
else
{
PREDICT
(
pred
,
ptr16
[
-
linesize
-
1
],
ptr16
[
-
linesize
],
ptr16
[
-
1
],
predictor
);
PREDICT
(
pred
,
ptr16
[
-
linesize
-
1
],
ptr16
[
-
linesize
],
ptr16
[
-
1
],
predictor
);
...
...
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