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
fc689477
Commit
fc689477
authored
May 07, 2016
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/m101: simplify 8bit code
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
22d1148c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
m101.c
libavcodec/m101.c
+2
-6
No files found.
libavcodec/m101.c
View file @
fc689477
...
...
@@ -45,7 +45,6 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
int
stride
,
ret
;
int
x
,
y
;
int
min_stride
=
2
*
avctx
->
width
;
uint8_t
*
line
;
int
bits
=
avctx
->
extradata
[
2
*
4
];
AVFrame
*
frame
=
data
;
...
...
@@ -65,7 +64,6 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
AVERROR_INVALIDDATA
;
}
line
=
frame
->
data
[
0
];
frame
->
interlaced_frame
=
((
avctx
->
extradata
[
3
*
4
]
&
3
)
!=
3
);
if
(
frame
->
interlaced_frame
)
frame
->
top_field_first
=
avctx
->
extradata
[
3
*
4
]
&
1
;
...
...
@@ -75,10 +73,8 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if
(
frame
->
interlaced_frame
)
src_y
=
((
y
&
1
)
^
frame
->
top_field_first
)
?
y
/
2
:
(
y
/
2
+
avctx
->
height
/
2
);
if
(
bits
==
8
)
{
for
(
x
=
0
;
x
<
avctx
->
width
;
x
++
)
{
line
[
y
*
frame
->
linesize
[
0
]
+
2
*
x
+
0
]
=
buf
[
src_y
*
stride
+
2
*
x
+
0
];
line
[
y
*
frame
->
linesize
[
0
]
+
2
*
x
+
1
]
=
buf
[
src_y
*
stride
+
2
*
x
+
1
];
}
uint8_t
*
line
=
frame
->
data
[
0
]
+
y
*
frame
->
linesize
[
0
];
memcpy
(
line
,
buf
+
src_y
*
stride
,
2
*
avctx
->
width
);
}
else
{
int
block
;
uint16_t
*
luma
=
(
uint16_t
*
)
&
frame
->
data
[
0
][
y
*
frame
->
linesize
[
0
]];
...
...
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