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
644a9262
Commit
644a9262
authored
Apr 25, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PIX_FMT_NONE and related fixes
Originally committed as revision 4161 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3ca4b654
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
12 deletions
+21
-12
ffmpeg.c
ffmpeg.c
+1
-1
asv1.c
libavcodec/asv1.c
+1
-0
avcodec.h
libavcodec/avcodec.h
+2
-1
rv10.c
libavcodec/rv10.c
+3
-3
snow.c
libavcodec/snow.c
+2
-0
utils.c
libavcodec/utils.c
+1
-0
img2.c
libavformat/img2.c
+1
-1
utils.c
libavformat/utils.c
+7
-3
regression.sh
tests/regression.sh
+3
-3
No files found.
ffmpeg.c
View file @
644a9262
...
...
@@ -86,7 +86,7 @@ static AVImageFormat *image_format;
static
int
frame_width
=
0
;
static
int
frame_height
=
0
;
static
float
frame_aspect_ratio
=
0
;
static
enum
PixelFormat
frame_pix_fmt
=
PIX_FMT_
YUV420P
;
static
enum
PixelFormat
frame_pix_fmt
=
PIX_FMT_
NONE
;
static
int
frame_padtop
=
0
;
static
int
frame_padbottom
=
0
;
static
int
frame_padleft
=
0
;
...
...
libavcodec/asv1.c
View file @
644a9262
...
...
@@ -557,6 +557,7 @@ static int decode_init(AVCodecContext *avctx){
common_init
(
avctx
);
init_vlcs
(
a
);
ff_init_scantable
(
a
->
dsp
.
idct_permutation
,
&
a
->
scantable
,
scantab
);
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
a
->
inv_qscale
=
((
uint8_t
*
)
avctx
->
extradata
)[
0
];
if
(
a
->
inv_qscale
==
0
){
...
...
libavcodec/avcodec.h
View file @
644a9262
...
...
@@ -17,7 +17,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "0.4.9-pre1"
#define LIBAVCODEC_BUILD 475
2
#define LIBAVCODEC_BUILD 475
3
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
...
...
@@ -206,6 +206,7 @@ enum CodecType {
* to run on the IBM VGA graphics adapter use 6-bit palette components.
*/
enum
PixelFormat
{
PIX_FMT_NONE
=
-
1
,
PIX_FMT_YUV420P
,
///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
PIX_FMT_YUV422
,
///< Packed pixel, Y0 Cb Y1 Cr
PIX_FMT_RGB24
,
///< Packed pixel, 3 bytes per pixel, RGBRGB...
...
...
libavcodec/rv10.c
View file @
644a9262
...
...
@@ -560,7 +560,9 @@ static int rv10_decode_init(AVCodecContext *avctx)
if
(
avctx
->
debug
&
FF_DEBUG_PICT_INFO
){
av_log
(
avctx
,
AV_LOG_DEBUG
,
"ver:%X ver0:%X
\n
"
,
avctx
->
sub_id
,
avctx
->
extradata_size
>=
4
?
((
uint32_t
*
)
avctx
->
extradata
)[
0
]
:
-
1
);
}
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
if
(
MPV_common_init
(
s
)
<
0
)
return
-
1
;
...
...
@@ -576,8 +578,6 @@ static int rv10_decode_init(AVCodecContext *avctx)
rv_chrom_code
,
2
,
2
,
1
);
done
=
1
;
}
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
return
0
;
}
...
...
libavcodec/snow.c
View file @
644a9262
...
...
@@ -3652,6 +3652,8 @@ static int decode_init(AVCodecContext *avctx)
{
SnowContext
*
s
=
avctx
->
priv_data
;
int
block_size
;
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
common_init
(
avctx
);
...
...
libavcodec/utils.c
View file @
644a9262
...
...
@@ -459,6 +459,7 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s
->
profile
=
FF_PROFILE_UNKNOWN
;
s
->
level
=
FF_LEVEL_UNKNOWN
;
s
->
me_penalty_compensation
=
256
;
s
->
pix_fmt
=
PIX_FMT_NONE
;
s
->
intra_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
s
->
inter_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
...
...
libavformat/img2.c
View file @
644a9262
...
...
@@ -222,7 +222,7 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st
->
codec
.
codec_type
=
CODEC_TYPE_VIDEO
;
st
->
codec
.
codec_id
=
av_str2id
(
img_tags
,
s
->
path
);
}
if
(
st
->
codec
.
codec_type
==
CODEC_TYPE_VIDEO
&&
ap
->
pix_fmt
)
if
(
st
->
codec
.
codec_type
==
CODEC_TYPE_VIDEO
&&
ap
->
pix_fmt
!=
PIX_FMT_NONE
)
st
->
codec
.
pix_fmt
=
ap
->
pix_fmt
;
return
0
;
...
...
libavformat/utils.c
View file @
644a9262
...
...
@@ -1682,7 +1682,7 @@ static int has_codec_parameters(AVCodecContext *enc)
val
=
enc
->
sample_rate
;
break
;
case
CODEC_TYPE_VIDEO
:
val
=
enc
->
width
;
val
=
enc
->
width
&&
enc
->
pix_fmt
!=
PIX_FMT_NONE
;
break
;
default
:
val
=
1
;
...
...
@@ -1704,6 +1704,8 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
ret
=
avcodec_open
(
&
st
->
codec
,
codec
);
if
(
ret
<
0
)
return
ret
;
if
(
!
has_codec_parameters
(
&
st
->
codec
)){
switch
(
st
->
codec
.
codec_type
)
{
case
CODEC_TYPE_VIDEO
:
ret
=
avcodec_decode_video
(
&
st
->
codec
,
&
picture
,
...
...
@@ -1720,6 +1722,7 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
default
:
break
;
}
}
fail
:
avcodec_close
(
&
st
->
codec
);
return
ret
;
...
...
@@ -1739,6 +1742,7 @@ static int try_decode_frame(AVStream *st, const uint8_t *data, int size)
*
* @param ic media file handle
* @return >=0 if OK. AVERROR_xxx if error.
* @todo let user decide somehow what information is needed so we dont waste time geting stuff the user doesnt need
*/
int
av_find_stream_info
(
AVFormatContext
*
ic
)
{
...
...
@@ -1841,7 +1845,7 @@ int av_find_stream_info(AVFormatContext *ic)
decompress the frame. We try to avoid that in most cases as
it takes longer and uses more memory. For MPEG4, we need to
decompress for Quicktime. */
if
(
!
has_codec_parameters
(
&
st
->
codec
)
&&
if
(
!
has_codec_parameters
(
&
st
->
codec
)
/*
&&
(st->codec.codec_id == CODEC_ID_FLV1 ||
st->codec.codec_id == CODEC_ID_H264 ||
st->codec.codec_id == CODEC_ID_H263 ||
...
...
@@ -1855,7 +1859,7 @@ int av_find_stream_info(AVFormatContext *ic)
st->codec.codec_id == CODEC_ID_PBM ||
st->codec.codec_id == CODEC_ID_PPM ||
st->codec.codec_id == CODEC_ID_SHORTEN ||
(
st
->
codec
.
codec_id
==
CODEC_ID_MPEG4
&&
!
st
->
need_parsing
)))
(st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing))
*/
)
try_decode_frame
(
st
,
pkt
->
data
,
pkt
->
size
);
if
(
st
->
codec_info_duration
>=
MAX_STREAM_DURATION
)
{
...
...
tests/regression.sh
View file @
644a9262
...
...
@@ -290,7 +290,7 @@ file=${outfile}huffyuv.avi
do_ffmpeg
$file
-y
-f
pgmyuv
-i
$raw_src
-an
-vcodec
huffyuv
-pix_fmt
yuv422p
$file
# huffyuv decoding
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
-strict
-1
$raw_dst
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
-strict
-1
-pix_fmt
yuv420p
$raw_dst
fi
###################################
...
...
@@ -370,7 +370,7 @@ file=${outfile}mjpeg.avi
do_ffmpeg
$file
-y
-qscale
10
-f
pgmyuv
-i
$raw_src
-an
-vcodec
mjpeg
-pix_fmt
yuvj420p
$file
# mjpeg decoding
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
$raw_dst
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
-pix_fmt
yuv420p
$raw_dst
fi
###################################
...
...
@@ -467,7 +467,7 @@ file=${outfile}svq1.mov
do_ffmpeg
$file
-y
-f
pgmyuv
-i
$raw_src
-an
-vcodec
svq1
-qscale
3
-pix_fmt
yuv410p
$file
# svq1 decoding
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
$raw_dst
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
-pix_fmt
yuv420p
$raw_dst
fi
###################################
...
...
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