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
b7397857
Commit
b7397857
authored
Jul 17, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add avcodec_enum_to_chroma_pos()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4443213d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
avcodec.h
libavcodec/avcodec.h
+11
-0
utils.c
libavcodec/utils.c
+12
-0
No files found.
libavcodec/avcodec.h
View file @
b7397857
...
...
@@ -3606,6 +3606,17 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
void
avcodec_align_dimensions2
(
AVCodecContext
*
s
,
int
*
width
,
int
*
height
,
int
linesize_align
[
AV_NUM_DATA_POINTERS
]);
/**
* Converts AVChromaLocation to swscale x/y chroma position.
*
* The positions represent the chroma (0,0) position in a coordinates system
* with luma (0,0) representing the origin and luma(1,1) representing 256,256
*
* @param xpos horizontal chroma sample position
* @param ypos vertical chroma sample position
*/
int
avcodec_enum_to_chroma_pos
(
int
*
xpos
,
int
*
ypos
,
enum
AVChromaLocation
pos
);
#if FF_API_OLD_DECODE_AUDIO
/**
* Wrapper function which calls avcodec_decode_audio4.
...
...
libavcodec/utils.c
View file @
b7397857
...
...
@@ -338,6 +338,18 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
*
width
=
FFALIGN
(
*
width
,
align
);
}
int
avcodec_enum_to_chroma_pos
(
int
*
xpos
,
int
*
ypos
,
enum
AVChromaLocation
pos
)
{
if
(
pos
<=
AVCHROMA_LOC_UNSPECIFIED
||
pos
>=
AVCHROMA_LOC_NB
)
return
AVERROR
(
EINVAL
);
pos
--
;
*
xpos
=
(
pos
&
1
)
*
128
;
*
ypos
=
((
pos
>>
1
)
^
(
pos
<
4
))
*
128
;
return
0
;
}
int
avcodec_fill_audio_frame
(
AVFrame
*
frame
,
int
nb_channels
,
enum
AVSampleFormat
sample_fmt
,
const
uint8_t
*
buf
,
int
buf_size
,
int
align
)
...
...
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