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
a45cf639
Commit
a45cf639
authored
May 22, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavformat/mux: Add ff_choose_chroma_location()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d09321b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
internal.h
libavformat/internal.h
+5
-0
mux.c
libavformat/mux.c
+30
-0
No files found.
libavformat/internal.h
View file @
a45cf639
...
...
@@ -410,6 +410,11 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
*/
AVRational
ff_choose_timebase
(
AVFormatContext
*
s
,
AVStream
*
st
,
int
min_precision
);
/**
* Chooses a timebase for muxing the specified stream.
*/
enum
AVChromaLocation
ff_choose_chroma_location
(
AVFormatContext
*
s
,
AVStream
*
st
);
/**
* Generate standard extradata for AVC-Intra based on width/height and field
* order.
...
...
libavformat/mux.c
View file @
a45cf639
...
...
@@ -115,6 +115,36 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precisio
return
q
;
}
enum
AVChromaLocation
ff_choose_chroma_location
(
AVFormatContext
*
s
,
AVStream
*
st
)
{
AVCodecContext
*
avctx
=
st
->
codec
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
if
(
avctx
->
chroma_sample_location
!=
AVCHROMA_LOC_UNSPECIFIED
)
return
avctx
->
chroma_sample_location
;
if
(
pix_desc
)
{
if
(
pix_desc
->
log2_chroma_h
==
0
)
{
return
AVCHROMA_LOC_TOPLEFT
;
}
else
if
(
pix_desc
->
log2_chroma_w
==
1
&&
pix_desc
->
log2_chroma_h
==
1
)
{
if
(
avctx
->
field_order
==
AV_FIELD_UNKNOWN
||
avctx
->
field_order
==
AV_FIELD_PROGRESSIVE
)
{
switch
(
avctx
->
codec_id
)
{
case
AV_CODEC_ID_MJPEG
:
case
AV_CODEC_ID_MPEG1VIDEO
:
return
AVCHROMA_LOC_CENTER
;
}
}
if
(
avctx
->
field_order
==
AV_FIELD_UNKNOWN
||
avctx
->
field_order
!=
AV_FIELD_PROGRESSIVE
)
{
switch
(
avctx
->
codec_id
)
{
case
AV_CODEC_ID_MPEG2VIDEO
:
return
AVCHROMA_LOC_LEFT
;
}
}
}
}
return
AVCHROMA_LOC_UNSPECIFIED
;
}
int
avformat_alloc_output_context2
(
AVFormatContext
**
avctx
,
AVOutputFormat
*
oformat
,
const
char
*
format
,
const
char
*
filename
)
{
...
...
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