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
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52023-05-xx - xxxxxxxxxx - lavc 60.12.100 - codec_desc.h
6 Add AV_CODEC_PROP_FIELDS.
7
52023-05-xx - xxxxxxxxxx - lavc 60 - codec.h82023-05-xx - xxxxxxxxxx - lavc 60 - codec.h
6 Depreate AV_CODEC_CAP_SUBFRAMES without replacement.9 Depreate AV_CODEC_CAP_SUBFRAMES without replacement.
7 10
libavcodec/codec_desc.c+12−4
@@ -38,14 +38,20 @@ static const AVCodecDescriptor codec_descriptors[] = { · 37 unmodified lines
38 .type = AVMEDIA_TYPE_VIDEO,38 .type = AVMEDIA_TYPE_VIDEO,
39 .name = "mpeg1video",39 .name = "mpeg1video",
40 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),40 .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,
42 },47 },
43 {48 {
44 .id = AV_CODEC_ID_MPEG2VIDEO,49 .id = AV_CODEC_ID_MPEG2VIDEO,
45 .type = AVMEDIA_TYPE_VIDEO,50 .type = AVMEDIA_TYPE_VIDEO,
46 .name = "mpeg2video",51 .name = "mpeg2video",
47 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),52 .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,
49 .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),55 .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
50 },56 },
51 {57 {
@@ -225,7 +231,8 @@ static const AVCodecDescriptor codec_descriptors[] = { · 173 unmodified lines
225 .type = AVMEDIA_TYPE_VIDEO,231 .type = AVMEDIA_TYPE_VIDEO,
226 .name = "h264",232 .name = "h264",
227 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),233 .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,
229 .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),236 .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
230 },237 },
231 {238 {
@@ -529,7 +536,8 @@ static const AVCodecDescriptor codec_descriptors[] = { · 297 unmodified lines
529 .type = AVMEDIA_TYPE_VIDEO,536 .type = AVMEDIA_TYPE_VIDEO,
530 .name = "vc1",537 .name = "vc1",
531 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),538 .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,
533 .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),541 .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
534 },542 },
535 {543 {
libavcodec/codec_desc.h+6−0
@@ -90,6 +90,12 @@ typedef struct AVCodecDescriptor { · 89 unmodified lines
90 * equal.90 * equal.
91 */91 */
92#define AV_CODEC_PROP_REORDER (1 << 3)92#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
93/**99/**
94 * Subtitle codec is bitmap based100 * Subtitle codec is bitmap based
95 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.101 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30#include "version_major.h"30#include "version_major.h"
31 31
32#define LIBAVCODEC_VERSION_MINOR 1132#define LIBAVCODEC_VERSION_MINOR 12
33#define LIBAVCODEC_VERSION_MICRO 10033#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, \

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