History

lavc/codec_desc: add a property for codecs that support field coding

Multiple places currently use AVCodecContext.ticks_per_frame > 1 to identify such codecs, which * requires a codec context * requires it to be open

Anton Khirnov committed 3 years ago

Commit 70433ab1 parent 78e84c04 files · +22 −5Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/codec_desc.c +12 −4
  3. libavcodec/codec_desc.h +6 −0
  4. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09 · 1 unmodified line
22
33 API changes, most recent first:
44
5+2023-05-xx - xxxxxxxxxx - lavc 60.12.100 - codec_desc.h
6+ Add AV_CODEC_PROP_FIELDS.
7+
58 2023-05-xx - xxxxxxxxxx - lavc 60 - codec.h
69 Depreate AV_CODEC_CAP_SUBFRAMES without replacement.
710
libavcodec/codec_desc.c+12−4
@@ -38,14 +38,20 @@ static const AVCodecDescriptor codec_descriptors[] = { · 37 unmodified lines
3838 .type = AVMEDIA_TYPE_VIDEO,
3939 .name = "mpeg1video",
4040 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
41− .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
41+ .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER |
42+ // FIXME this is strigly speaking not true, as MPEG-1 does
43+ // not allow field coding, but our mpeg12 code (decoder and
44+ // parser) can sometimes change codec id at runtime, so
45+ // this is safer
46+ AV_CODEC_PROP_FIELDS,
4247 },
4348 {
4449 .id = AV_CODEC_ID_MPEG2VIDEO,
4550 .type = AVMEDIA_TYPE_VIDEO,
4651 .name = "mpeg2video",
4752 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
48− .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
53+ .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER |
54+ AV_CODEC_PROP_FIELDS,
4955 .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
5056 },
5157 {
@@ -225,7 +231,8 @@ static const AVCodecDescriptor codec_descriptors[] = { · 173 unmodified lines
225231 .type = AVMEDIA_TYPE_VIDEO,
226232 .name = "h264",
227233 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
228− .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER,
234+ .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS |
235+ AV_CODEC_PROP_REORDER | AV_CODEC_PROP_FIELDS,
229236 .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
230237 },
231238 {
@@ -529,7 +536,8 @@ static const AVCodecDescriptor codec_descriptors[] = { · 297 unmodified lines
529536 .type = AVMEDIA_TYPE_VIDEO,
530537 .name = "vc1",
531538 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
532− .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
539+ .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER |
540+ AV_CODEC_PROP_FIELDS,
533541 .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
534542 },
535543 {
libavcodec/codec_desc.h+6−0
@@ -90,6 +90,12 @@ typedef struct AVCodecDescriptor { · 89 unmodified lines
9090 * equal.
9191 */
9292 #define AV_CODEC_PROP_REORDER (1 << 3)
93+
94+/**
95+ * Video codec supports separate coding of fields in interlaced frames.
96+ */
97+#define AV_CODEC_PROP_FIELDS (1 << 4)
98+
9399 /**
94100 * Subtitle codec is bitmap based
95101 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 #include "version_major.h"
3131
32−#define LIBAVCODEC_VERSION_MINOR 11
32+#define LIBAVCODEC_VERSION_MINOR 12
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

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