Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Sat, 11 May 2019 17:40:41 +0200 Michael Niedermayer wrote: > On Thu, May 09, 2019 at 10:59:12PM -0700, Philip Langdale wrote: > > I don't think this is terribly useful, as the only thing out there > > that can even handle NV24 content is VDPAU and the only time you > > have to deal with it is when doing VDPAU OpenGL interop where > > swscale is irrelevant. In the other cases you can use YV24 > > (YUV444P). > > > > But anyway, I was asked to do this for the sake of completeness. > > > > The implementation is pretty straight-forward. Most of the existing > > NV12 codepaths work regardless of subsampling and are re-used as is. > > Where necessary I wrote the slightly different NV24 versions. > > > > Finally, the one thing that confused me for a long time was the > > asm specific x86 path that did an explicit exclusion check for NV12. > > I replaced that with a semi-planar check and also updated the > > equivalent PPC code, but which I cannot test. > > > > Signed-off-by: Philip Langdale > > --- > > libswscale/input.c | 2 + > > libswscale/output.c | 6 ++- > > libswscale/ppc/swscale_altivec.c | 3 +- > > libswscale/ppc/swscale_vsx.c | 3 +- > > libswscale/swscale_unscaled.c| 51 > > libswscale/utils.c > > | 2 + libswscale/version.h | 2 +- > > libswscale/x86/swscale_template.c| 4 +- > > tests/ref/fate/filter-pixfmts-copy | 2 + > > tests/ref/fate/filter-pixfmts-crop | 2 + > > tests/ref/fate/filter-pixfmts-field | 2 + > > tests/ref/fate/filter-pixfmts-fieldorder | 2 + > > tests/ref/fate/filter-pixfmts-hflip | 2 + > > tests/ref/fate/filter-pixfmts-il | 2 + > > tests/ref/fate/filter-pixfmts-null | 2 + > > tests/ref/fate/filter-pixfmts-pad| 2 + > > tests/ref/fate/filter-pixfmts-scale | 2 + > > tests/ref/fate/filter-pixfmts-transpose | 2 + > > tests/ref/fate/filter-pixfmts-vflip | 2 + > > 19 files changed, 86 insertions(+), 9 deletions(-) > > was this tested with up/down scaling ? > > thanks > Yes. - --phil -BEGIN PGP SIGNATURE- iHUEARYIAB0WIQRokRbWmcX6x+Nv+3hgE8jODULZ6QUCXNb+yQAKCRBgE8jODULZ 6eHxAP9gGwsOidh6k77QyWcRLMk8zr2Uh6qizKPT21h9PYzQEwD8CvYOiRAem/qS UrTfd6pFClXNO27PQEL8aeioZqOH7g8= =pTPw -END PGP SIGNATURE- ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Sat, May 11, 2019 at 05:40:41PM +0200, Michael Niedermayer wrote: > On Thu, May 09, 2019 at 10:59:12PM -0700, Philip Langdale wrote: > > I don't think this is terribly useful, as the only thing out there that > > can even handle NV24 content is VDPAU and the only time you have to > > deal with it is when doing VDPAU OpenGL interop where swscale is > > irrelevant. In the other cases you can use YV24 (YUV444P). > > > > But anyway, I was asked to do this for the sake of completeness. > > > > The implementation is pretty straight-forward. Most of the existing > > NV12 codepaths work regardless of subsampling and are re-used as is. > > Where necessary I wrote the slightly different NV24 versions. > > > > Finally, the one thing that confused me for a long time was the > > asm specific x86 path that did an explicit exclusion check for NV12. > > I replaced that with a semi-planar check and also updated the > > equivalent PPC code, but which I cannot test. > > > > Signed-off-by: Philip Langdale > > --- > > libswscale/input.c | 2 + > > libswscale/output.c | 6 ++- > > libswscale/ppc/swscale_altivec.c | 3 +- > > libswscale/ppc/swscale_vsx.c | 3 +- > > libswscale/swscale_unscaled.c| 51 > > libswscale/utils.c | 2 + > > libswscale/version.h | 2 +- > > libswscale/x86/swscale_template.c| 4 +- > > tests/ref/fate/filter-pixfmts-copy | 2 + > > tests/ref/fate/filter-pixfmts-crop | 2 + > > tests/ref/fate/filter-pixfmts-field | 2 + > > tests/ref/fate/filter-pixfmts-fieldorder | 2 + > > tests/ref/fate/filter-pixfmts-hflip | 2 + > > tests/ref/fate/filter-pixfmts-il | 2 + > > tests/ref/fate/filter-pixfmts-null | 2 + > > tests/ref/fate/filter-pixfmts-pad| 2 + > > tests/ref/fate/filter-pixfmts-scale | 2 + > > tests/ref/fate/filter-pixfmts-transpose | 2 + > > tests/ref/fate/filter-pixfmts-vflip | 2 + > > 19 files changed, 86 insertions(+), 9 deletions(-) > > was this tested with up/down scaling ? also seems to require this: diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index 6c41a86e1e..bc8147e3c7 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -178,6 +178,8 @@ isYUV: nv20be nv20le nv21 + nv24 + nv42 p010be p010le p016be @@ -268,6 +270,8 @@ isPlanarYUV: nv20be nv20le nv21 + nv24 + nv42 p010be p010le p016be @@ -703,6 +707,8 @@ Planar: nv20be nv20le nv21 + nv24 + nv42 p010be p010le p016be [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart then the original author, trying to rewrite it will not make it better. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Thu, May 09, 2019 at 10:59:12PM -0700, Philip Langdale wrote: > I don't think this is terribly useful, as the only thing out there that > can even handle NV24 content is VDPAU and the only time you have to > deal with it is when doing VDPAU OpenGL interop where swscale is > irrelevant. In the other cases you can use YV24 (YUV444P). > > But anyway, I was asked to do this for the sake of completeness. > > The implementation is pretty straight-forward. Most of the existing > NV12 codepaths work regardless of subsampling and are re-used as is. > Where necessary I wrote the slightly different NV24 versions. > > Finally, the one thing that confused me for a long time was the > asm specific x86 path that did an explicit exclusion check for NV12. > I replaced that with a semi-planar check and also updated the > equivalent PPC code, but which I cannot test. > > Signed-off-by: Philip Langdale > --- > libswscale/input.c | 2 + > libswscale/output.c | 6 ++- > libswscale/ppc/swscale_altivec.c | 3 +- > libswscale/ppc/swscale_vsx.c | 3 +- > libswscale/swscale_unscaled.c| 51 > libswscale/utils.c | 2 + > libswscale/version.h | 2 +- > libswscale/x86/swscale_template.c| 4 +- > tests/ref/fate/filter-pixfmts-copy | 2 + > tests/ref/fate/filter-pixfmts-crop | 2 + > tests/ref/fate/filter-pixfmts-field | 2 + > tests/ref/fate/filter-pixfmts-fieldorder | 2 + > tests/ref/fate/filter-pixfmts-hflip | 2 + > tests/ref/fate/filter-pixfmts-il | 2 + > tests/ref/fate/filter-pixfmts-null | 2 + > tests/ref/fate/filter-pixfmts-pad| 2 + > tests/ref/fate/filter-pixfmts-scale | 2 + > tests/ref/fate/filter-pixfmts-transpose | 2 + > tests/ref/fate/filter-pixfmts-vflip | 2 + > 19 files changed, 86 insertions(+), 9 deletions(-) was this tested with up/down scaling ? thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Fri, 10 May 2019 10:08:57 -0700 Philip Langdale wrote: > On 2019-05-10 08:12, Lauri Kasanen wrote: > > On Fri, 10 May 2019 08:07:45 -0700 > > Philip Langdale wrote: > > > >> On Fri, 10 May 2019 09:35:40 +0300 > >> Lauri Kasanen wrote: > >> > >> > > >> > I'm having trouble making out what formats exactly isSemiPlanarYUV() > >> > matches. Are you sure it's an equivalent check? > >> > > >> > >> Well, the check's been in there for quite a while; that's not new. > >> > >> (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane); > >> > >> So, any planar yuv format where component 1 and component 2 are on the > >> same plane. Except for semi planar formats, you expect either all > >> components on the same plane (packed, so not planar) or every > >> component > >> on a separate plain (normal planar). > > > > Yes, I understand that. I mean: can you list all formats that function > > matches? > > For formats that swscale understands: > > NV12, NV21 > P010(BE|LE) > P016(BE|LE) > > and now NV24, NV42. > > There are also NV16 and NV20(BE|LE) formats which are not supported by > swscale. Thanks. Then the ppc part looks ok to me. Please include that list in the commit message too. - Lauri ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On 2019-05-10 08:12, Lauri Kasanen wrote: On Fri, 10 May 2019 08:07:45 -0700 Philip Langdale wrote: On Fri, 10 May 2019 09:35:40 +0300 Lauri Kasanen wrote: > > I'm having trouble making out what formats exactly isSemiPlanarYUV() > matches. Are you sure it's an equivalent check? > Well, the check's been in there for quite a while; that's not new. (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane); So, any planar yuv format where component 1 and component 2 are on the same plane. Except for semi planar formats, you expect either all components on the same plane (packed, so not planar) or every component on a separate plain (normal planar). Yes, I understand that. I mean: can you list all formats that function matches? For formats that swscale understands: NV12, NV21 P010(BE|LE) P016(BE|LE) and now NV24, NV42. There are also NV16 and NV20(BE|LE) formats which are not supported by swscale. --phil ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Fri, 10 May 2019 09:35:40 +0300 Lauri Kasanen wrote: > > I'm having trouble making out what formats exactly isSemiPlanarYUV() > matches. Are you sure it's an equivalent check? > Well, the check's been in there for quite a while; that's not new. (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane); So, any planar yuv format where component 1 and component 2 are on the same plane. Except for semi planar formats, you expect either all components on the same plane (packed, so not planar) or every component on a separate plain (normal planar). --phil ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Fri, 10 May 2019 08:07:45 -0700 Philip Langdale wrote: > On Fri, 10 May 2019 09:35:40 +0300 > Lauri Kasanen wrote: > > > > > I'm having trouble making out what formats exactly isSemiPlanarYUV() > > matches. Are you sure it's an equivalent check? > > > > Well, the check's been in there for quite a while; that's not new. > > (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane); > > So, any planar yuv format where component 1 and component 2 are on the > same plane. Except for semi planar formats, you expect either all > components on the same plane (packed, so not planar) or every component > on a separate plain (normal planar). Yes, I understand that. I mean: can you list all formats that function matches? - Lauri ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Fri, 10 May 2019 11:03:46 +0200 Carl Eugen Hoyos wrote: > Am Fr., 10. Mai 2019 um 07:59 Uhr schrieb Philip Langdale > : > > > > I don't think this is terribly useful, as the only thing out there > > that can even handle NV24 content is VDPAU and the only time you > > have to deal with it is when doing VDPAU OpenGL interop where > > swscale is irrelevant. In the other cases you can use YV24 > > (YUV444P). > > I believe this information was missing from the other commit message > (or I missed it which is absolutely possible). > > Could it be worthwhile to test where within the vdpau / opengl > pipeline an issue is making this patch useful? I mentioned this in the thread around the previous patch. There's no issue - the interop extension always returns semi planar formats by design, previously just nv12 for 420 content but now nv24 for 444 content. As I also mentioned, I've got an mpv patch that uses the new pixel format to correctly handle this case in the interop. Thanks, --phil ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
Am Fr., 10. Mai 2019 um 07:59 Uhr schrieb Philip Langdale : > > I don't think this is terribly useful, as the only thing out there that > can even handle NV24 content is VDPAU and the only time you have to > deal with it is when doing VDPAU OpenGL interop where swscale is > irrelevant. In the other cases you can use YV24 (YUV444P). I believe this information was missing from the other commit message (or I missed it which is absolutely possible). Could it be worthwhile to test where within the vdpau / opengl pipeline an issue is making this patch useful? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] swscale: Add support for NV24 and NV42
On Thu, 9 May 2019 22:59:12 -0700 Philip Langdale wrote: > I don't think this is terribly useful, as the only thing out there that > can even handle NV24 content is VDPAU and the only time you have to > deal with it is when doing VDPAU OpenGL interop where swscale is > irrelevant. In the other cases you can use YV24 (YUV444P). > > But anyway, I was asked to do this for the sake of completeness. > > The implementation is pretty straight-forward. Most of the existing > NV12 codepaths work regardless of subsampling and are re-used as is. > Where necessary I wrote the slightly different NV24 versions. > > Finally, the one thing that confused me for a long time was the > asm specific x86 path that did an explicit exclusion check for NV12. > I replaced that with a semi-planar check and also updated the > equivalent PPC code, but which I cannot test. I'm having trouble making out what formats exactly isSemiPlanarYUV() matches. Are you sure it's an equivalent check? - Lauri ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".