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
fcee0164
Commit
fcee0164
authored
May 12, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
automatic pixel format selection
Originally committed as revision 3131 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4a1b9ba0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
ffmpeg.c
ffmpeg.c
+13
-1
avcodec.h
libavcodec/avcodec.h
+1
-0
svq1.c
libavcodec/svq1.c
+2
-0
No files found.
ffmpeg.c
View file @
fcee0164
...
@@ -2744,6 +2744,7 @@ static void opt_output_file(const char *filename)
...
@@ -2744,6 +2744,7 @@ static void opt_output_file(const char *filename)
}
else
{
}
else
{
char
*
p
;
char
*
p
;
int
i
;
int
i
;
AVCodec
*
codec
;
codec_id
=
file_oformat
->
video_codec
;
codec_id
=
file_oformat
->
video_codec
;
if
(
video_codec_id
!=
CODEC_ID_NONE
)
if
(
video_codec_id
!=
CODEC_ID_NONE
)
...
@@ -2759,7 +2760,18 @@ static void opt_output_file(const char *filename)
...
@@ -2759,7 +2760,18 @@ static void opt_output_file(const char *filename)
video_enc
->
width
=
frame_width
+
frame_padright
+
frame_padleft
;
video_enc
->
width
=
frame_width
+
frame_padright
+
frame_padleft
;
video_enc
->
height
=
frame_height
+
frame_padtop
+
frame_padbottom
;
video_enc
->
height
=
frame_height
+
frame_padtop
+
frame_padbottom
;
video_enc
->
sample_aspect_ratio
=
av_d2q
(
frame_aspect_ratio
*
frame_height
/
frame_width
,
255
);
video_enc
->
sample_aspect_ratio
=
av_d2q
(
frame_aspect_ratio
*
frame_height
/
frame_width
,
255
);
video_enc
->
pix_fmt
=
frame_pix_fmt
;
video_enc
->
pix_fmt
=
frame_pix_fmt
;
codec
=
avcodec_find_encoder
(
codec_id
);
if
(
codec
&&
codec
->
pix_fmts
){
const
enum
PixelFormat
*
p
=
codec
->
pix_fmts
;
for
(;
*
p
!=-
1
;
p
++
){
if
(
*
p
==
video_enc
->
pix_fmt
)
break
;
}
if
(
*
p
==
-
1
)
video_enc
->
pix_fmt
=
codec
->
pix_fmts
[
0
];
}
if
(
!
intra_only
)
if
(
!
intra_only
)
video_enc
->
gop_size
=
gop_size
;
video_enc
->
gop_size
=
gop_size
;
...
...
libavcodec/avcodec.h
View file @
fcee0164
...
@@ -1658,6 +1658,7 @@ typedef struct AVCodec {
...
@@ -1658,6 +1658,7 @@ typedef struct AVCodec {
struct
AVCodec
*
next
;
struct
AVCodec
*
next
;
void
(
*
flush
)(
AVCodecContext
*
);
void
(
*
flush
)(
AVCodecContext
*
);
const
AVRational
*
supported_framerates
;
///array of supported framerates, or NULL if any, array is terminated by {0,0}
const
AVRational
*
supported_framerates
;
///array of supported framerates, or NULL if any, array is terminated by {0,0}
const
enum
PixelFormat
*
pix_fmts
;
///array of supported pixel formats, or NULL if unknown, array is terminanted by -1
}
AVCodec
;
}
AVCodec
;
/**
/**
...
...
libavcodec/svq1.c
View file @
fcee0164
...
@@ -1933,6 +1933,7 @@ AVCodec svq1_decoder = {
...
@@ -1933,6 +1933,7 @@ AVCodec svq1_decoder = {
svq1_decode_frame
,
svq1_decode_frame
,
CODEC_CAP_DR1
,
CODEC_CAP_DR1
,
.
flush
=
ff_mpeg_flush
,
.
flush
=
ff_mpeg_flush
,
.
pix_fmts
=
(
enum
PixelFormat
[]){
PIX_FMT_YUV410P
,
-
1
},
};
};
#ifdef CONFIG_ENCODERS
#ifdef CONFIG_ENCODERS
...
@@ -1945,6 +1946,7 @@ AVCodec svq1_encoder = {
...
@@ -1945,6 +1946,7 @@ AVCodec svq1_encoder = {
svq1_encode_init
,
svq1_encode_init
,
svq1_encode_frame
,
svq1_encode_frame
,
svq1_encode_end
,
svq1_encode_end
,
.
pix_fmts
=
(
enum
PixelFormat
[]){
PIX_FMT_YUV410P
,
-
1
},
};
};
#endif //CONFIG_ENCODERS
#endif //CONFIG_ENCODERS
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