diff avcodec.h @ 11311:ee2e050815be libavcodec

Fix avcodec_align_dimensions to return values suitably aligned for FLV decoding with SSE and add a avcodec_align_dimensions2 taht returns the stride alignment requirements independently from doing the width/height padding.
author reimar
date Sat, 27 Feb 2010 21:13:22 +0000
parents 14535f3deafb
children 7b9896e85410
line wrap: on
line diff
--- a/avcodec.h	Sat Feb 27 14:08:06 2010 +0000
+++ b/avcodec.h	Sat Feb 27 21:13:22 2010 +0000
@@ -1367,7 +1367,7 @@
     /**
      * Called at the beginning of each frame to get a buffer for it.
      * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions() should be used to find the required width and
+     * 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.
      * if CODEC_CAP_DR1 is not set then get_buffer() must call
      * avcodec_default_get_buffer() instead of providing buffers allocated by
@@ -3226,7 +3226,19 @@
 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
 int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
+/**
+ * Modifies width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you do not use any horizontal
+ * padding.
+ */
 void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
+/**
+ * Modifies width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you also ensure that all
+ * line sizes are a multiple of the respective linesize_align[i].
+ */
+void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
+                               int linesize_align[4]);
 
 /**
  * Checks if the given dimension of a picture is valid, meaning that all