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
b155fb08
Commit
b155fb08
authored
Sep 06, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegdec: move shift_output() to its own function
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c407c734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
mjpegdec.c
libavcodec/mjpegdec.c
+16
-12
No files found.
libavcodec/mjpegdec.c
View file @
b155fb08
...
@@ -1044,6 +1044,20 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
...
@@ -1044,6 +1044,20 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
}
}
}
}
static
void
shift_output
(
MJpegDecodeContext
*
s
,
uint8_t
*
ptr
,
int
linesize
)
{
int
block_x
,
block_y
;
if
(
s
->
bits
>
8
)
{
for
(
block_y
=
0
;
block_y
<
8
;
block_y
++
)
for
(
block_x
=
0
;
block_x
<
8
;
block_x
++
)
*
(
uint16_t
*
)(
ptr
+
2
*
block_x
+
block_y
*
linesize
)
<<=
16
-
s
->
bits
;
}
else
{
for
(
block_y
=
0
;
block_y
<
8
;
block_y
++
)
for
(
block_x
=
0
;
block_x
<
8
;
block_x
++
)
*
(
ptr
+
block_x
+
block_y
*
linesize
)
<<=
8
-
s
->
bits
;
}
}
static
int
mjpeg_decode_scan
(
MJpegDecodeContext
*
s
,
int
nb_components
,
int
Ah
,
static
int
mjpeg_decode_scan
(
MJpegDecodeContext
*
s
,
int
nb_components
,
int
Ah
,
int
Al
,
const
uint8_t
*
mb_bitmask
,
int
Al
,
const
uint8_t
*
mb_bitmask
,
const
AVFrame
*
reference
)
const
AVFrame
*
reference
)
...
@@ -1123,18 +1137,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
...
@@ -1123,18 +1137,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
s
->
dsp
.
idct_put
(
ptr
,
linesize
[
c
],
s
->
block
);
s
->
dsp
.
idct_put
(
ptr
,
linesize
[
c
],
s
->
block
);
if
(
s
->
bits
&
7
)
{
if
(
s
->
bits
&
7
)
int
block_x
,
block_y
;
shift_output
(
s
,
ptr
,
linesize
[
c
]);
if
(
s
->
bits
>
8
)
{
for
(
block_y
=
0
;
block_y
<
8
;
block_y
++
)
for
(
block_x
=
0
;
block_x
<
8
;
block_x
++
)
*
(
uint16_t
*
)(
ptr
+
2
*
block_x
+
block_y
*
linesize
[
c
])
<<=
16
-
s
->
bits
;
}
else
{
for
(
block_y
=
0
;
block_y
<
8
;
block_y
++
)
for
(
block_x
=
0
;
block_x
<
8
;
block_x
++
)
*
(
ptr
+
2
*
block_x
+
block_y
*
linesize
[
c
])
<<=
8
-
s
->
bits
;
}
}
}
}
}
else
{
}
else
{
int
block_idx
=
s
->
block_stride
[
c
]
*
(
v
*
mb_y
+
y
)
+
int
block_idx
=
s
->
block_stride
[
c
]
*
(
v
*
mb_y
+
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