On Sat, 6 May 2017, Nicolas George wrote:

TODO Actual implementation.

Signed-off-by: Nicolas George <geo...@nsup.org>
---
libavutil/frame.h | 9 +++++++++
1 file changed, 9 insertions(+)


Here is a proposal for actually fixing the alignment problems that are all
over the place in the current code base.

Note that it is only a design proposal, all the actual implementation is
missing. I do not want to waste my time implementing if the design is to be
bikeshedded to death.


diff --git a/libavutil/frame.h b/libavutil/frame.h
index 4d8c1bed4f..162ea0716c 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -746,6 +746,15 @@ void av_frame_remove_side_data(AVFrame *frame, enum 
AVFrameSideDataType type);
const char *av_frame_side_data_name(enum AVFrameSideDataType type);

/**
+ * Realign the data pointers of a frame.
+ * Make sure all frame data pointers have the alignment lower bits cleared,
+ * i.e. are a multiple of 1<<alignment.
+ * If not, a new frame is allocated and overwrites the current one.
+ * @return  >=0 for success or an AVERROR code.

I suggest to return 1 if an actual alignment (with deep copy) happened.

+ */
+int av_frame_realign(AVFrame *frame, unsigned align);
+
+/**
 * @}
 */

Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to