History

avutil/frame: Remove AVFrame QP table API

Originally deprecated in 1296b1f6c0631ab79464e22d48a6a1548450b943; scheduled again for removal in a9915268327b097bba84a07f68968d8c07f4b549.

Andreas Rheinhardt committed 5 years ago

Commit b8accd11 parent ad524cb4 files · +0 −175Browse files

Unified · Split

4 files
  1. libavfilter/f_sidedata.c +0 −34
  2. libavutil/frame.c +0 −97
  3. libavutil/frame.h +0 −41
  4. libavutil/version.h +0 −3
libavfilter/f_sidedata.c+0−34
@@ -43,7 +43,6 @@ typedef struct SideDataContext { · 42 unmodified lines
4343 } SideDataContext;
4444
4545 #define OFFSET(x) offsetof(SideDataContext, x)
46−#if FF_API_FRAME_QP
4746 #define DEFINE_OPTIONS(filt_name, FLAGS) \
4847 static const AVOption filt_name##_options[] = { \
4948 { "mode", "set a mode of operation", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
@@ -66,8 +65,6 @@ static const AVOption filt_name##_options[] = { \ · 16 unmodified lines
6665 { "SPHERICAL", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_SPHERICAL }, 0, 0, FLAGS, "type" }, \
6766 { "CONTENT_LIGHT_LEVEL", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_CONTENT_LIGHT_LEVEL }, 0, 0, FLAGS, "type" }, \
6867 { "ICC_PROFILE", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_ICC_PROFILE }, 0, 0, FLAGS, "type" }, \
69− { "QP_TABLE_PROPERTIES", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_QP_TABLE_PROPERTIES }, 0, 0, FLAGS, "type" }, \
70− { "QP_TABLE_DATA", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_QP_TABLE_DATA }, 0, 0, FLAGS, "type" }, \
7168 { "S12M_TIMECOD", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_S12M_TIMECODE }, 0, 0, FLAGS, "type" }, \
7269 { "DYNAMIC_HDR_PLUS", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DYNAMIC_HDR_PLUS }, 0, 0, FLAGS, "type" }, \
7370 { "REGIONS_OF_INTEREST", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_REGIONS_OF_INTEREST }, 0, 0, FLAGS, "type" }, \
@@ -75,37 +72,6 @@ static const AVOption filt_name##_options[] = { \ · 1 unmodified line
7572 { "SEI_UNREGISTERED", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_SEI_UNREGISTERED }, 0, 0, FLAGS, "type" }, \
7673 { NULL } \
7774 }
78−#else
79−#define DEFINE_OPTIONS(filt_name, FLAGS) \
80−static const AVOption filt_name##_options[] = { \
81− { "mode", "set a mode of operation", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
82− { "select", "select frame", 0, AV_OPT_TYPE_CONST, {.i64 = SIDEDATA_SELECT }, 0, 0, FLAGS, "mode" }, \
83− { "delete", "delete side data", 0, AV_OPT_TYPE_CONST, {.i64 = SIDEDATA_DELETE }, 0, 0, FLAGS, "mode" }, \
84− { "type", "set side data type", OFFSET(type), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, FLAGS, "type" }, \
85− { "PANSCAN", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_PANSCAN }, 0, 0, FLAGS, "type" }, \
86− { "A53_CC", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_A53_CC }, 0, 0, FLAGS, "type" }, \
87− { "STEREO3D", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_STEREO3D }, 0, 0, FLAGS, "type" }, \
88− { "MATRIXENCODING", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_MATRIXENCODING }, 0, 0, FLAGS, "type" }, \
89− { "DOWNMIX_INFO", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DOWNMIX_INFO }, 0, 0, FLAGS, "type" }, \
90− { "REPLAYGAIN", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_REPLAYGAIN }, 0, 0, FLAGS, "type" }, \
91− { "DISPLAYMATRIX", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DISPLAYMATRIX }, 0, 0, FLAGS, "type" }, \
92− { "AFD", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_AFD }, 0, 0, FLAGS, "type" }, \
93− { "MOTION_VECTORS", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_MOTION_VECTORS }, 0, 0, FLAGS, "type" }, \
94− { "SKIP_SAMPLES", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_SKIP_SAMPLES }, 0, 0, FLAGS, "type" }, \
95− { "AUDIO_SERVICE_TYPE", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_AUDIO_SERVICE_TYPE }, 0, 0, FLAGS, "type" }, \
96− { "MASTERING_DISPLAY_METADATA", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_MASTERING_DISPLAY_METADATA }, 0, 0, FLAGS, "type" }, \
97− { "GOP_TIMECODE", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_GOP_TIMECODE }, 0, 0, FLAGS, "type" }, \
98− { "SPHERICAL", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_SPHERICAL }, 0, 0, FLAGS, "type" }, \
99− { "CONTENT_LIGHT_LEVEL", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_CONTENT_LIGHT_LEVEL }, 0, 0, FLAGS, "type" }, \
100− { "ICC_PROFILE", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_ICC_PROFILE }, 0, 0, FLAGS, "type" }, \
101− { "S12M_TIMECOD", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_S12M_TIMECODE }, 0, 0, FLAGS, "type" }, \
102− { "DYNAMIC_HDR_PLUS", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DYNAMIC_HDR_PLUS }, 0, 0, FLAGS, "type" }, \
103− { "REGIONS_OF_INTEREST", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_REGIONS_OF_INTEREST }, 0, 0, FLAGS, "type" }, \
104− { "DETECTION_BOUNDING_BOXES", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DETECTION_BBOXES }, 0, 0, FLAGS, "type" }, \
105− { "SEI_UNREGISTERED", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_SEI_UNREGISTERED }, 0, 0, FLAGS, "type" }, \
106− { NULL } \
107−}
108−#endif
10975
11076 static av_cold int init(AVFilterContext *ctx)
11177 {
libavutil/frame.c+0−97
@@ -46,80 +46,6 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range) · 45 unmodified lines
4646 (frame)->channels == \
4747 av_get_channel_layout_nb_channels((frame)->channel_layout))
4848
49−#if FF_API_FRAME_QP
50−struct qp_properties {
51− int stride;
52− int type;
53−};
54−
55−int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
56−{
57− struct qp_properties *p;
58− AVFrameSideData *sd;
59− AVBufferRef *ref;
60−
61−FF_DISABLE_DEPRECATION_WARNINGS
62− av_buffer_unref(&f->qp_table_buf);
63−
64− f->qp_table_buf = buf;
65− f->qscale_table = buf->data;
66− f->qstride = stride;
67− f->qscale_type = qp_type;
68−FF_ENABLE_DEPRECATION_WARNINGS
69−
70− av_frame_remove_side_data(f, AV_FRAME_DATA_QP_TABLE_PROPERTIES);
71− av_frame_remove_side_data(f, AV_FRAME_DATA_QP_TABLE_DATA);
72−
73− ref = av_buffer_ref(buf);
74− if (!av_frame_new_side_data_from_buf(f, AV_FRAME_DATA_QP_TABLE_DATA, ref)) {
75− av_buffer_unref(&ref);
76− return AVERROR(ENOMEM);
77− }
78−
79− sd = av_frame_new_side_data(f, AV_FRAME_DATA_QP_TABLE_PROPERTIES,
80− sizeof(struct qp_properties));
81− if (!sd)
82− return AVERROR(ENOMEM);
83−
84− p = (struct qp_properties *)sd->data;
85− p->stride = stride;
86− p->type = qp_type;
87−
88− return 0;
89−}
90−
91−int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
92−{
93− AVBufferRef *buf = NULL;
94−
95− *stride = 0;
96− *type = 0;
97−
98−FF_DISABLE_DEPRECATION_WARNINGS
99− if (f->qp_table_buf) {
100− *stride = f->qstride;
101− *type = f->qscale_type;
102− buf = f->qp_table_buf;
103−FF_ENABLE_DEPRECATION_WARNINGS
104− } else {
105− AVFrameSideData *sd;
106− struct qp_properties *p;
107− sd = av_frame_get_side_data(f, AV_FRAME_DATA_QP_TABLE_PROPERTIES);
108− if (!sd)
109− return NULL;
110− p = (struct qp_properties *)sd->data;
111− sd = av_frame_get_side_data(f, AV_FRAME_DATA_QP_TABLE_DATA);
112− if (!sd)
113− return NULL;
114− *stride = p->stride;
115− *type = p->type;
116− buf = sd->buf;
117− }
118−
119− return buf ? buf->data : NULL;
120−}
121−#endif
122−
12349 #if FF_API_COLORSPACE_NAME
12450 const char *av_get_colorspace_name(enum AVColorSpace val)
12551 {
@@ -422,20 +348,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 296 unmodified lines
422348 av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
423349 }
424350
425−#if FF_API_FRAME_QP
426−FF_DISABLE_DEPRECATION_WARNINGS
427− dst->qscale_table = NULL;
428− dst->qstride = 0;
429− dst->qscale_type = 0;
430− av_buffer_replace(&dst->qp_table_buf, src->qp_table_buf);
431− if (dst->qp_table_buf) {
432− dst->qscale_table = dst->qp_table_buf->data;
433− dst->qstride = src->qstride;
434− dst->qscale_type = src->qscale_type;
435− }
436−FF_ENABLE_DEPRECATION_WARNINGS
437−#endif
438−
439351 ret = av_buffer_replace(&dst->opaque_ref, src->opaque_ref);
440352 ret |= av_buffer_replace(&dst->private_ref, src->private_ref);
441353 return ret;
@@ -566,11 +478,6 @@ void av_frame_unref(AVFrame *frame) · 124 unmodified lines
566478 av_buffer_unref(&frame->extended_buf[i]);
567479 av_freep(&frame->extended_buf);
568480 av_dict_free(&frame->metadata);
569−#if FF_API_FRAME_QP
570−FF_DISABLE_DEPRECATION_WARNINGS
571− av_buffer_unref(&frame->qp_table_buf);
572−FF_ENABLE_DEPRECATION_WARNINGS
573−#endif
574481
575482 av_buffer_unref(&frame->hw_frames_ctx);
576483
@@ -844,10 +751,6 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type) · 267 unmodified lines
844751 case AV_FRAME_DATA_S12M_TIMECODE: return "SMPTE 12-1 timecode";
845752 case AV_FRAME_DATA_SPHERICAL: return "Spherical Mapping";
846753 case AV_FRAME_DATA_ICC_PROFILE: return "ICC profile";
847−#if FF_API_FRAME_QP
848− case AV_FRAME_DATA_QP_TABLE_PROPERTIES: return "QP table properties";
849− case AV_FRAME_DATA_QP_TABLE_DATA: return "QP table data";
850−#endif
851754 case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata SMPTE2094-40 (HDR10+)";
852755 case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest";
853756 case AV_FRAME_DATA_VIDEO_ENC_PARAMS: return "Video encoding parameters";
libavutil/frame.h+0−41
@@ -142,23 +142,6 @@ enum AVFrameSideDataType { · 141 unmodified lines
142142 */
143143 AV_FRAME_DATA_ICC_PROFILE,
144144
145−#if FF_API_FRAME_QP
146− /**
147− * Implementation-specific description of the format of AV_FRAME_QP_TABLE_DATA.
148− * The contents of this side data are undocumented and internal; use
149− * av_frame_set_qp_table() and av_frame_get_qp_table() to access this in a
150− * meaningful way instead.
151− */
152− AV_FRAME_DATA_QP_TABLE_PROPERTIES,
153−
154− /**
155− * Raw QP table data. Its format is described by
156− * AV_FRAME_DATA_QP_TABLE_PROPERTIES. Use av_frame_set_qp_table() and
157− * av_frame_get_qp_table() to access this instead.
158− */
159− AV_FRAME_DATA_QP_TABLE_DATA,
160−#endif
161−
162145 /**
163146 * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
164147 * where the first uint32_t describes how many (1-3) of the other timecodes are used.
@@ -638,24 +621,6 @@ typedef struct AVFrame { · 473 unmodified lines
638621 */
639622 int pkt_size;
640623
641−#if FF_API_FRAME_QP
642− /**
643− * QP table
644− */
645− attribute_deprecated
646− int8_t *qscale_table;
647− /**
648− * QP store stride
649− */
650− attribute_deprecated
651− int qstride;
652−
653− attribute_deprecated
654− int qscale_type;
655−
656− attribute_deprecated
657− AVBufferRef *qp_table_buf;
658−#endif
659624 /**
660625 * For hwaccel-format frames, this should be a reference to the
661626 * AVHWFramesContext describing the frame.
@@ -744,12 +709,6 @@ attribute_deprecated · 82 unmodified lines
744709 int av_frame_get_pkt_size(const AVFrame *frame);
745710 attribute_deprecated
746711 void av_frame_set_pkt_size(AVFrame *frame, int val);
747−#if FF_API_FRAME_QP
748−attribute_deprecated
749−int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
750−attribute_deprecated
751−int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
752−#endif
753712 attribute_deprecated
754713 enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
755714 attribute_deprecated
libavutil/version.h+0−3
@@ -105,9 +105,6 @@ · 104 unmodified lines
105105 * @{
106106 */
107107
108−#ifndef FF_API_FRAME_QP
109−#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57)
110−#endif
111108 #ifndef FF_API_PLUS1_MINUS1
112109 #define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 57)
113110 #endif

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