[FFmpeg-cvslog] lavc: deprecate CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().

Anton Khirnov git at videolan.org
Mon Jan 20 19:54:43 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Jan  2 11:07:11 2014 +0100| [93c553c71ef48550ff7c2aa7b5712a7e01f1999f] | committer: Anton Khirnov

lavc: deprecate CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93c553c71ef48550ff7c2aa7b5712a7e01f1999f
---

 doc/APIchanges       |    5 +++++
 libavcodec/avcodec.h |   21 +++++++++++++--------
 libavcodec/utils.c   |    7 +++++++
 libavcodec/version.h |    5 ++++-
 4 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1152ecd..e4bd6d8 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,11 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-01-xx - xxxxxxx - lavc 55.32.1 - avcodec.h
+  Edges are not required anymore on video buffers allocated by get_buffer2()
+  (i.e. as if the CODEC_FLAG_EMU_EDGE flag was always on). Deprecate
+  CODEC_FLAG_EMU_EDGE and avcodec_get_edge_width().
+
 2013-12-xx - xxxxxxx - lavu 53.2.0 - frame.h
   Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
   identifies AVMatrixEncoding data.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 9531c85..6332837 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -667,7 +667,13 @@ typedef struct RcOverride{
 #define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
 #define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
 #define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
+#if FF_API_EMU_EDGE
+/**
+ * @deprecated edges are not used/required anymore. I.e. this flag is now always
+ * set.
+ */
+#define CODEC_FLAG_EMU_EDGE        0x4000
+#endif
 #define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
 #define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
                                                   location instead of only at frame boundaries. */
@@ -2000,9 +2006,6 @@ typedef struct AVCodecContext {
      * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
      * (read and/or written to if it is writable) later by libavcodec.
      *
-     * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an
-     * edge of the size returned by avcodec_get_edge_width() on all sides.
-     *
      * avcodec_align_dimensions2() should be used to find the required width and
      * height, as they normally need to be rounded up to the next multiple of 16.
      *
@@ -3404,14 +3407,20 @@ attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame
  */
 int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
 
+#if FF_API_EMU_EDGE
 /**
  * Return the amount of padding in pixels which the get_buffer callback must
  * provide around the edge of the image for codecs which do not have the
  * CODEC_FLAG_EMU_EDGE flag.
  *
  * @return Required padding in pixels.
+ *
+ * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer
+ * needed
  */
+attribute_deprecated
 unsigned avcodec_get_edge_width(void);
+#endif
 
 /**
  * Modify width and height values so that they will result in a memory
@@ -3419,8 +3428,6 @@ unsigned avcodec_get_edge_width(void);
  * padding.
  *
  * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
  */
 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
 
@@ -3430,8 +3437,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
  * line sizes are a multiple of the respective linesize_align[i].
  *
  * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
  */
 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
                                int linesize_align[AV_NUM_DATA_POINTERS]);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ed68d0f..2e418ec 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -127,10 +127,12 @@ av_cold void avcodec_register(AVCodec *codec)
         codec->init_static_data(codec);
 }
 
+#if FF_API_EMU_EDGE
 unsigned avcodec_get_edge_width(void)
 {
     return EDGE_WIDTH;
 }
+#endif
 
 #if FF_API_SET_DIMENSIONS
 void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
@@ -1089,6 +1091,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
             ret = AVERROR(EINVAL);
             goto free_and_end;
         }
+
+#if FF_API_EMU_EDGE
+        /* force the emu edge flag on, since it's now always active */
+        avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
     }
 end:
     entangled_thread_counter--;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 2aee76e..59bc361 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 55
 #define LIBAVCODEC_VERSION_MINOR 32
-#define LIBAVCODEC_VERSION_MICRO  0
+#define LIBAVCODEC_VERSION_MICRO  1
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
@@ -120,5 +120,8 @@
 #ifndef FF_API_NEG_LINESIZES
 #define FF_API_NEG_LINESIZES     (LIBAVCODEC_VERSION_MAJOR < 56)
 #endif
+#ifndef FF_API_EMU_EDGE
+#define FF_API_EMU_EDGE          (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
 
 #endif /* AVCODEC_VERSION_H */



More information about the ffmpeg-cvslog mailing list