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
1515
1616 API changes, most recent first:
1717
18+2013-07-XX - xxxxxxx - XXXXXXXXXXXXXX - avcodec.h
19+ Add avcodec_chroma_pos_to_enum()
20+ Add avcodec_enum_to_chroma_pos()
21+
1822 2013-07-03 - xxxxxxx - lavfi 3.78.100 - avfilter.h
1923 Deprecate avfilter_graph_parse() in favor of the equivalent
2024 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
36173617 */
36183618 int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
36193619
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+ */
3629+enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
3630+
36203631 #if FF_API_OLD_DECODE_AUDIO
36213632 /**
36223633 * 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
350350 return 0;
351351 }
352352
353+enum 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+
353364 int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
354365 enum AVSampleFormat sample_fmt, const uint8_t *buf,
355366 int buf_size, int align)
libavcodec/version.h+2−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include "libavutil/avutil.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
32−#define LIBAVCODEC_VERSION_MINOR 18
33−#define LIBAVCODEC_VERSION_MICRO 102
32+#define LIBAVCODEC_VERSION_MINOR 19
33+#define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 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