[FFmpeg-devel] [PATCH 1/3] lavu/frame: add av_frame_realign().

Muhammad Faiz mfcc64 at gmail.com
Sat May 6 17:16:19 EEST 2017


On Sat, May 6, 2017 at 4:20 PM, Nicolas George <george at nsup.org> wrote:
> TODO Actual implementation.
>
> Signed-off-by: Nicolas George <george at 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.
> + */
> +int av_frame_realign(AVFrame *frame, unsigned align);
> +
> +/**
>   * @}
>   */
>
> --
> 2.11.0

Whatever the result here (accepted or rejected), we still need a fix
without API change. Otherwise, it can't go to 3.3 branch.

Thank's.


More information about the ffmpeg-devel mailing list