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
b50eef3a
Commit
b50eef3a
authored
Jun 09, 2002
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grayscale only decoding
Originally committed as revision 677 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
800d7ceb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
avcodec.h
libavcodec/avcodec.h
+4
-2
h263dec.c
libavcodec/h263dec.c
+1
-0
mpegvideo.c
libavcodec/mpegvideo.c
+21
-6
No files found.
libavcodec/avcodec.h
View file @
b50eef3a
...
...
@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 461
3
#define LIBAVCODEC_BUILD_STR "461
3
"
#define LIBAVCODEC_BUILD 461
4
#define LIBAVCODEC_BUILD_STR "461
4
"
enum
CodecID
{
CODEC_ID_NONE
,
...
...
@@ -23,6 +23,7 @@ enum CodecID {
CODEC_ID_MSMPEG4V2
,
CODEC_ID_MSMPEG4V3
,
CODEC_ID_WMV1
,
CODEC_ID_WMV2
,
CODEC_ID_H263P
,
CODEC_ID_H263I
,
...
...
@@ -97,6 +98,7 @@ static const int Motion_Est_QTab[] = { ME_ZERO, ME_PHODS, ME_LOG,
#define CODEC_FLAG_PASS1 0x0200
/* use internal 2pass ratecontrol in first pass mode */
#define CODEC_FLAG_PASS2 0x0400
/* use internal 2pass ratecontrol in second pass mode */
#define CODEC_FLAG_EXTERN_HUFF 0x1000
/* use external huffman table (for mjpeg) */
#define CODEC_FLAG_GRAY 0x2000
/* only decode/encode grayscale */
/* codec capabilities */
...
...
libavcodec/h263dec.c
View file @
b50eef3a
...
...
@@ -124,6 +124,7 @@ uint64_t time= rdtsc();
s
->
hurry_up
=
avctx
->
hurry_up
;
s
->
error_resilience
=
avctx
->
error_resilience
;
s
->
workaround_bugs
=
avctx
->
workaround_bugs
;
s
->
flags
=
avctx
->
flags
;
/* no supplementary picture */
if
(
buf_size
==
0
)
{
...
...
libavcodec/mpegvideo.c
View file @
b50eef3a
...
...
@@ -155,10 +155,12 @@ int MPV_common_init(MpegEncContext *s)
CHECKED_ALLOCZ
(
pict
,
c_size
)
s
->
last_picture_base
[
i
]
=
pict
;
s
->
last_picture
[
i
]
=
pict
+
pict_start
;
if
(
i
>
0
)
memset
(
s
->
last_picture_base
[
i
],
128
,
c_size
);
CHECKED_ALLOCZ
(
pict
,
c_size
)
s
->
next_picture_base
[
i
]
=
pict
;
s
->
next_picture
[
i
]
=
pict
+
pict_start
;
if
(
i
>
0
)
memset
(
s
->
next_picture_base
[
i
],
128
,
c_size
);
if
(
s
->
has_b_frames
||
s
->
codec_id
==
CODEC_ID_MPEG4
)
{
/* Note the MPEG4 stuff is here cuz of buggy encoders which dont set the low_delay flag but
...
...
@@ -166,6 +168,7 @@ int MPV_common_init(MpegEncContext *s)
CHECKED_ALLOCZ
(
pict
,
c_size
)
s
->
aux_picture_base
[
i
]
=
pict
;
s
->
aux_picture
[
i
]
=
pict
+
pict_start
;
if
(
i
>
0
)
memset
(
s
->
aux_picture_base
[
i
],
128
,
c_size
);
}
}
...
...
@@ -886,6 +889,8 @@ if(s->quarter_sample)
pix_op
[
dxy
](
dest_y
,
ptr
,
linesize
,
h
);
pix_op
[
dxy
](
dest_y
+
8
,
ptr
+
8
,
linesize
,
h
);
if
(
s
->
flags
&
CODEC_FLAG_GRAY
)
return
;
if
(
s
->
out_format
==
FMT_H263
)
{
dxy
=
0
;
if
((
motion_x
&
3
)
!=
0
)
...
...
@@ -949,6 +954,8 @@ static inline void qpel_motion(MpegEncContext *s,
qpix_op
[
dxy
](
dest_y
+
linesize
*
8
,
ptr
+
linesize
*
8
,
linesize
,
linesize
,
motion_x
&
3
,
motion_y
&
3
);
qpix_op
[
dxy
](
dest_y
+
linesize
*
8
+
8
,
ptr
+
linesize
*
8
+
8
,
linesize
,
linesize
,
motion_x
&
3
,
motion_y
&
3
);
if
(
s
->
flags
&
CODEC_FLAG_GRAY
)
return
;
mx
=
(
motion_x
>>
1
)
|
(
motion_x
&
1
);
my
=
(
motion_y
>>
1
)
|
(
motion_y
&
1
);
...
...
@@ -1037,6 +1044,8 @@ static inline void MPV_motion(MpegEncContext *s,
dest
=
dest_y
+
((
i
&
1
)
*
8
)
+
(
i
>>
1
)
*
8
*
s
->
linesize
;
pix_op
[
dxy
](
dest
,
ptr
,
s
->
linesize
,
8
);
}
if
(
s
->
flags
&
CODEC_FLAG_GRAY
)
break
;
/* In case of 8X8, we construct a single chroma motion vector
with a special rounding */
mx
=
0
;
...
...
@@ -1292,16 +1301,20 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
add_dequant_dct
(
s
,
block
[
2
],
2
,
dest_y
+
dct_offset
,
dct_linesize
);
add_dequant_dct
(
s
,
block
[
3
],
3
,
dest_y
+
dct_offset
+
8
,
dct_linesize
);
add_dequant_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
add_dequant_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
add_dequant_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
add_dequant_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
}
}
else
{
add_dct
(
s
,
block
[
0
],
0
,
dest_y
,
dct_linesize
);
add_dct
(
s
,
block
[
1
],
1
,
dest_y
+
8
,
dct_linesize
);
add_dct
(
s
,
block
[
2
],
2
,
dest_y
+
dct_offset
,
dct_linesize
);
add_dct
(
s
,
block
[
3
],
3
,
dest_y
+
dct_offset
+
8
,
dct_linesize
);
add_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
add_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
add_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
add_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
}
}
}
else
{
/* dct only in intra block */
...
...
@@ -1310,8 +1323,10 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
put_dct
(
s
,
block
[
2
],
2
,
dest_y
+
dct_offset
,
dct_linesize
);
put_dct
(
s
,
block
[
3
],
3
,
dest_y
+
dct_offset
+
8
,
dct_linesize
);
put_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
put_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)){
put_dct
(
s
,
block
[
4
],
4
,
dest_cb
,
s
->
linesize
>>
1
);
put_dct
(
s
,
block
[
5
],
5
,
dest_cr
,
s
->
linesize
>>
1
);
}
}
}
the_end:
...
...
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