Re: [FFmpeg-devel] [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-11-28 Thread Jun Zhao


On 2017/11/28 21:23, Carl Eugen Hoyos wrote:
> 2017-11-28 6:20 GMT+01:00 Jun Zhao :
>
> Could be split.
Do you means split with 2 patches? 1) for issue fix 2) for coding
reconstruct ?
>
> Carl Eugen
> ___
> 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] [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-11-28 Thread Jun Zhao


On 2017/11/29 7:09, Michael Niedermayer wrote:
> On Tue, Nov 28, 2017 at 01:20:59PM +0800, Jun Zhao wrote:
>>  vp8.c |   46 ++
>>  1 file changed, 34 insertions(+), 12 deletions(-)
>> d548af3b82a9d77f67fe9621fc7aeee0392fcc89  
>> 0001-lavc-vp8-Fix-HWAccel-VP8-decoder-can-t-support-resol.patch
>> From 94d511d93fdb83103fdafbd9ca0d02abfbd2e305 Mon Sep 17 00:00:00 2001
>> From: Jun Zhao 
>> Date: Tue, 28 Nov 2017 21:05:18 +0800
>> Subject: [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution
>>  change.
>>
>> Use the following command to reproduce this issue:
>> make fate-vp8-size-change HWACCEL="vaapi -vaapi_device \
>> /dev/dri/renderD128 -hwaccel_output_format yuv420p"
>> SAMPLES=../fate-suite/.
>>
>> At the same time, reconstruct the public logic as a function.
>>
>> Signed-off-by: Yun Zhou 
>> Signed-off-by: Jun Zhao 
>> ---
>>  libavcodec/vp8.c | 46 ++
>>  1 file changed, 34 insertions(+), 12 deletions(-)
> Causes fate-webp-rgba-lossy-q80 to segfault
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00ceee65 in vp8_lossy_decode_alpha (avctx=0x21c7da0, p=0x21c8980, 
> data_start=0x21caa67 "\027 
> \020HR\331\037r\215\210\b\a\261`r\a8\177\235\020\"\372\037\064\001VP8 R", 
> data_size=25) at libavcodec/webp.c:1312
> 1312*pp = *ap;
> (gdb) bt
> Python Exception  No module named gdb.frames:
> #0  0x00ceee65 in vp8_lossy_decode_alpha (avctx=0x21c7da0, 
> p=0x21c8980, data_start=0x21caa67 "\027 
> \020HR\331\037r\215\210\b\a\261`r\a8\177\235\020\"\372\037\064\001VP8 R", 
> data_size=25) at libavcodec/webp.c:1312
> #1  0x00cef050 in vp8_lossy_decode_frame (avctx=0x21c7da0, 
> p=0x21c8980, got_frame=0x7fffd648, data_start=0x21caa88 "\320\001", 
> data_size=82) at libavcodec/webp.c:1362
> #2  0x00cef357 in webp_decode_frame (avctx=0x21c7da0, data=0x21c8980, 
> got_frame=0x7fffd648, avpkt=0x21c8ca0) at libavcodec/webp.c:1421
> #3  0x00875781 in decode_simple_internal (avctx=0x21c7da0, 
> frame=0x21c8980) at libavcodec/decode.c:398
> #4  0x00876408 in decode_simple_receive_frame (avctx=0x21c7da0, 
> frame=0x21c8980) at libavcodec/decode.c:594
> #5  0x008764d3 in decode_receive_frame_internal (avctx=0x21c7da0, 
> frame=0x21c8980) at libavcodec/decode.c:612
> #6  0x0087674b in avcodec_send_packet (avctx=0x21c7da0, 
> avpkt=0x7fffd7f0) at libavcodec/decode.c:674
> #7  0x007be3e1 in try_decode_frame (s=0x21c6420, st=0x21c7480, 
> avpkt=0x7fffd9a0, options=0x21c6e20) at libavformat/utils.c:3007
> #8  0x007c174a in avformat_find_stream_info (ic=0x21c6420, 
> options=0x21c6e20) at libavformat/utils.c:3832
> #9  0x004154a5 in open_input_file (o=0x7fffdcf0, 
> filename=0x7fffe688 
> "/home/michael/fatesamples/fate/fate-suite//webp/rgba_q80.webp") at 
> fftools/ffmpeg_opt.c:1091
> #10 0x0041f061 in open_files (l=0x21c5d78, inout=0x11fa077 "input", 
> open_file=0x4149d3 ) at fftools/ffmpeg_opt.c:3296
> #11 0x0041f1f3 in ffmpeg_parse_options (argc=17, argv=0x7fffe308) 
> at fftools/ffmpeg_opt.c:3336
> #12 0x0043d5d2 in main (argc=17, argv=0x7fffe308) at 
> fftools/ffmpeg.c:4837
>
> [...]
Will check the segmentation fault, Tks.
>
>
> ___
> 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] [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-11-28 Thread Michael Niedermayer
On Tue, Nov 28, 2017 at 01:20:59PM +0800, Jun Zhao wrote:
> 

>  vp8.c |   46 ++
>  1 file changed, 34 insertions(+), 12 deletions(-)
> d548af3b82a9d77f67fe9621fc7aeee0392fcc89  
> 0001-lavc-vp8-Fix-HWAccel-VP8-decoder-can-t-support-resol.patch
> From 94d511d93fdb83103fdafbd9ca0d02abfbd2e305 Mon Sep 17 00:00:00 2001
> From: Jun Zhao 
> Date: Tue, 28 Nov 2017 21:05:18 +0800
> Subject: [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution
>  change.
> 
> Use the following command to reproduce this issue:
> make fate-vp8-size-change HWACCEL="vaapi -vaapi_device \
> /dev/dri/renderD128 -hwaccel_output_format yuv420p"
> SAMPLES=../fate-suite/.
> 
> At the same time, reconstruct the public logic as a function.
> 
> Signed-off-by: Yun Zhou 
> Signed-off-by: Jun Zhao 
> ---
>  libavcodec/vp8.c | 46 ++
>  1 file changed, 34 insertions(+), 12 deletions(-)

Causes fate-webp-rgba-lossy-q80 to segfault

Program received signal SIGSEGV, Segmentation fault.
0x00ceee65 in vp8_lossy_decode_alpha (avctx=0x21c7da0, p=0x21c8980, 
data_start=0x21caa67 "\027 
\020HR\331\037r\215\210\b\a\261`r\a8\177\235\020\"\372\037\064\001VP8 R", 
data_size=25) at libavcodec/webp.c:1312
1312*pp = *ap;
(gdb) bt
Python Exception  No module named gdb.frames:
#0  0x00ceee65 in vp8_lossy_decode_alpha (avctx=0x21c7da0, p=0x21c8980, 
data_start=0x21caa67 "\027 
\020HR\331\037r\215\210\b\a\261`r\a8\177\235\020\"\372\037\064\001VP8 R", 
data_size=25) at libavcodec/webp.c:1312
#1  0x00cef050 in vp8_lossy_decode_frame (avctx=0x21c7da0, p=0x21c8980, 
got_frame=0x7fffd648, data_start=0x21caa88 "\320\001", data_size=82) at 
libavcodec/webp.c:1362
#2  0x00cef357 in webp_decode_frame (avctx=0x21c7da0, data=0x21c8980, 
got_frame=0x7fffd648, avpkt=0x21c8ca0) at libavcodec/webp.c:1421
#3  0x00875781 in decode_simple_internal (avctx=0x21c7da0, 
frame=0x21c8980) at libavcodec/decode.c:398
#4  0x00876408 in decode_simple_receive_frame (avctx=0x21c7da0, 
frame=0x21c8980) at libavcodec/decode.c:594
#5  0x008764d3 in decode_receive_frame_internal (avctx=0x21c7da0, 
frame=0x21c8980) at libavcodec/decode.c:612
#6  0x0087674b in avcodec_send_packet (avctx=0x21c7da0, 
avpkt=0x7fffd7f0) at libavcodec/decode.c:674
#7  0x007be3e1 in try_decode_frame (s=0x21c6420, st=0x21c7480, 
avpkt=0x7fffd9a0, options=0x21c6e20) at libavformat/utils.c:3007
#8  0x007c174a in avformat_find_stream_info (ic=0x21c6420, 
options=0x21c6e20) at libavformat/utils.c:3832
#9  0x004154a5 in open_input_file (o=0x7fffdcf0, 
filename=0x7fffe688 
"/home/michael/fatesamples/fate/fate-suite//webp/rgba_q80.webp") at 
fftools/ffmpeg_opt.c:1091
#10 0x0041f061 in open_files (l=0x21c5d78, inout=0x11fa077 "input", 
open_file=0x4149d3 ) at fftools/ffmpeg_opt.c:3296
#11 0x0041f1f3 in ffmpeg_parse_options (argc=17, argv=0x7fffe308) 
at fftools/ffmpeg_opt.c:3336
#12 0x0043d5d2 in main (argc=17, argv=0x7fffe308) at 
fftools/ffmpeg.c:4837

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-11-28 Thread Carl Eugen Hoyos
2017-11-28 6:20 GMT+01:00 Jun Zhao :

Could be split.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-11-27 Thread Jun Zhao

From 94d511d93fdb83103fdafbd9ca0d02abfbd2e305 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Tue, 28 Nov 2017 21:05:18 +0800
Subject: [PATCH] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution
 change.

Use the following command to reproduce this issue:
make fate-vp8-size-change HWACCEL="vaapi -vaapi_device \
/dev/dri/renderD128 -hwaccel_output_format yuv420p"
SAMPLES=../fate-suite/.

At the same time, reconstruct the public logic as a function.

Signed-off-by: Yun Zhou 
Signed-off-by: Jun Zhao 
---
 libavcodec/vp8.c | 46 ++
 1 file changed, 34 insertions(+), 12 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 471c0bb89e..5bf00a44f9 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -167,6 +167,30 @@ static VP8Frame *vp8_find_free_buffer(VP8Context *s)
 return frame;
 }
 
+static enum AVPixelFormat get_pixel_format(VP8Context *s)
+{
+enum AVPixelFormat fmt;
+enum AVPixelFormat pix_fmts[] = {
+#if CONFIG_VP8_VAAPI_HWACCEL
+AV_PIX_FMT_VAAPI,
+#endif
+#if CONFIG_VP8_NVDEC_HWACCEL
+AV_PIX_FMT_CUDA,
+#endif
+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_NONE,
+};
+
+fmt = ff_get_format(s->avctx, pix_fmts);
+if (fmt < 0) {
+fmt = AV_PIX_FMT_NONE;
+av_log(s->avctx, AV_LOG_ERROR,
+   "Can not support the format. \n");
+}
+
+return fmt;
+}
+
 static av_always_inline
 int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
 {
@@ -182,6 +206,15 @@ int update_dimensions(VP8Context *s, int width, int 
height, int is_vp7)
 return ret;
 }
 
+if (!is_vp7) {
+s->pix_fmt = get_pixel_format(s);
+if (s->pix_fmt < 0) {
+ret = AVERROR(EINVAL);
+return ret;
+}
+avctx->pix_fmt = s->pix_fmt;
+}
+
 s->mb_width  = (s->avctx->coded_width  + 15) / 16;
 s->mb_height = (s->avctx->coded_height + 15) / 16;
 
@@ -2598,18 +2631,7 @@ int vp78_decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 if (s->actually_webp) {
 // avctx->pix_fmt already set in caller.
 } else if (!is_vp7 && s->pix_fmt == AV_PIX_FMT_NONE) {
-enum AVPixelFormat pix_fmts[] = {
-#if CONFIG_VP8_VAAPI_HWACCEL
-AV_PIX_FMT_VAAPI,
-#endif
-#if CONFIG_VP8_NVDEC_HWACCEL
-AV_PIX_FMT_CUDA,
-#endif
-AV_PIX_FMT_YUV420P,
-AV_PIX_FMT_NONE,
-};
-
-s->pix_fmt = ff_get_format(s->avctx, pix_fmts);
+s->pix_fmt = get_pixel_format(s);
 if (s->pix_fmt < 0) {
 ret = AVERROR(EINVAL);
 goto err;
-- 
2.14.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel