History

avcodec: add avcodec_chroma_pos_to_enum()

Michael Niedermayer committed 13 years ago

Commit abc81101 parent b7397854 files · +28 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +11 −0
  3. libavcodec/utils.c +11 −0
  4. libavcodec/version.h +2 −2
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2012-10-22 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182013-07-XX - xxxxxxx - XXXXXXXXXXXXXX - avcodec.h
19 Add avcodec_chroma_pos_to_enum()
20 Add avcodec_enum_to_chroma_pos()
21
182013-07-03 - xxxxxxx - lavfi 3.78.100 - avfilter.h222013-07-03 - xxxxxxx - lavfi 3.78.100 - avfilter.h
19 Deprecate avfilter_graph_parse() in favor of the equivalent23 Deprecate avfilter_graph_parse() in favor of the equivalent
20 avfilter_graph_parse_ptr().24 avfilter_graph_parse_ptr().
libavcodec/avcodec.h+11−0
@@ -3617,6 +3617,17 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, · 3616 unmodified lines
3617 */3617 */
3618int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);3618int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
3619 3619
3620/**
3621 * Converts swscale x/y chroma position to AVChromaLocation.
3622 *
3623 * The positions represent the chroma (0,0) position in a coordinates system
3624 * with luma (0,0) representing the origin and luma(1,1) representing 256,256
3625 *
3626 * @param xpos horizontal chroma sample position
3627 * @param ypos vertical chroma sample position
3628 */
3629enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
3630
3620#if FF_API_OLD_DECODE_AUDIO3631#if FF_API_OLD_DECODE_AUDIO
3621/**3632/**
3622 * Wrapper function which calls avcodec_decode_audio4.3633 * Wrapper function which calls avcodec_decode_audio4.
libavcodec/utils.c+11−0
@@ -350,6 +350,17 @@ int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos) · 349 unmodified lines
350 return 0;350 return 0;
351}351}
352 352
353enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos)
354{
355 int pos, xout, yout;
356
357 for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) {
358 if (avcodec_enum_to_chroma_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos)
359 return pos;
360 }
361 return AVCHROMA_LOC_UNSPECIFIED;
362}
363
353int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,364int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
354 enum AVSampleFormat sample_fmt, const uint8_t *buf,365 enum AVSampleFormat sample_fmt, const uint8_t *buf,
355 int buf_size, int align)366 int buf_size, int align)
libavcodec/version.h+2−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5531#define LIBAVCODEC_VERSION_MAJOR 55
32#define LIBAVCODEC_VERSION_MINOR 1832#define LIBAVCODEC_VERSION_MINOR 19
33#define LIBAVCODEC_VERSION_MICRO 10233#define LIBAVCODEC_VERSION_MICRO 100
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 LIBAVCODEC_VERSION_MINOR, \36 LIBAVCODEC_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t