Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
2017-03-08 2:15 GMT+01:00 Dzung Hoang: > I implemented a 32-bit float GBRAP/GBRP pixel format and used it in > vf_zscale.c and vf_overlay.c. I also implemented an EXR encoder using > miniexr that uses the new float pixel format. I can contribute this if > there is interest. > I used the above mods to do HDR video processing that includes overlaying > HDR and SDR video. IMHO, for ffmpeg to handle HDR video well, float and > half-float are needed and also metadata to signal the color space and > transfer function for each picture. It's a big job that can touch a lot of > code, which is why I kept my changes private and limited to only what I > need. > > If you already working on this, it can be interesting to post your work on this mailing list. I think the integration of float processing, can be made by steps (input/output pixels formats, exr encoder, integration in filter(s)) Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
I implemented a 32-bit float GBRAP/GBRP pixel format and used it in vf_zscale.c and vf_overlay.c. I also implemented an EXR encoder using miniexr that uses the new float pixel format. I can contribute this if there is interest. I used the above mods to do HDR video processing that includes overlaying HDR and SDR video. IMHO, for ffmpeg to handle HDR video well, float and half-float are needed and also metadata to signal the color space and transfer function for each picture. It's a big job that can touch a lot of code, which is why I kept my changes private and limited to only what I need. From: Martin Vignali <martin.vign...@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Sent: Tuesday, March 7, 2017 4:16 PM Subject: Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float Hello @Carl : I make some tests in order to avoid temp buffer, but i have some strange result, when i not use a temp buffer. > Time to think about a float pixfmt? I find it weird that we support > excessively obscure pixfmts like AV_PIX_FMT_BGR4_BYTE, but then have > hacks like this one if the codec uses float data. > > (I'm just commenting, not arguing for/against your actual patch.) > I agree with your comment. Float pixfmt is a more clean way. it can also be useful for image processing with filters, and encoding float data. Any tips to add support for float pixfmts ? I try to take a look to the source code, but it's not very easy to understand. Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
Hello @Carl : I make some tests in order to avoid temp buffer, but i have some strange result, when i not use a temp buffer. > Time to think about a float pixfmt? I find it weird that we support > excessively obscure pixfmts like AV_PIX_FMT_BGR4_BYTE, but then have > hacks like this one if the codec uses float data. > > (I'm just commenting, not arguing for/against your actual patch.) > I agree with your comment. Float pixfmt is a more clean way. it can also be useful for image processing with filters, and encoding float data. Any tips to add support for float pixfmts ? I try to take a look to the source code, but it's not very easy to understand. Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
On Wed, 1 Mar 2017 23:42:28 +0100 Martin Vignaliwrote: > Hello, > > In attach patch for decoding float data (rgb/gray only) inside psd > Like in the openexr decoder, float data is convert to uint16 > A gamma conversion can be apply before uint16 conversion (with an option) > > the function : static inline uint16_t psd_flt2uint(uint32_t v) > is a copy/paste of exr_flt_uint of the exr decoder. > Probably need to be move somewhere (but i don't know the best place for that) > > Sample can be found here : > https://we.tl/85kvceapTL Time to think about a float pixfmt? I find it weird that we support excessively obscure pixfmts like AV_PIX_FMT_BGR4_BYTE, but then have hacks like this one if the codec uses float data. (I'm just commenting, not arguing for/against your actual patch.) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
2017-03-01 23:42 GMT+01:00 Martin Vignali: > Hello, > > In attach patch for decoding float data (rgb/gray only) inside psd > Like in the openexr decoder, float data is convert to uint16 > A gamma conversion can be apply before uint16 conversion (with an option) > > the function : static inline uint16_t psd_flt2uint(uint32_t v) > is a copy/paste of exr_flt_uint of the exr decoder. > Probably need to be move somewhere (but i don't know the best place for that) If no other suggestions are made, move it to libavcodec/internal.h and make it av_always_inline. Is the buffer always necessary, or can the transformation be done in-place? > Sample can be found here : > https://we.tl/85kvceapTL Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] libavcodec/psd : add support for rgb/gray float
Hello, In attach patch for decoding float data (rgb/gray only) inside psd Like in the openexr decoder, float data is convert to uint16 A gamma conversion can be apply before uint16 conversion (with an option) the function : static inline uint16_t psd_flt2uint(uint32_t v) is a copy/paste of exr_flt_uint of the exr decoder. Probably need to be move somewhere (but i don't know the best place for that) Sample can be found here : https://we.tl/85kvceapTL Comments welcome Martin 0001-libavcodec-psd-add-support-for-rgb-gray-float.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel