[FFmpeg-devel] [PATCH] dxva2_hevc: fix ucNumDeltaPocsOfRefRpsIdx
It needs to point to the value from the sps rps, not the final computed one from the slice header. --- libavcodec/dxva2_hevc.c | 2 +- libavcodec/hevc.h | 1 + libavcodec/hevc_ps.c| 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 7e39677..79d2d28 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -92,7 +92,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext * pp-init_qp_minus26 = pps-pic_init_qp_minus26; if (h-sh.short_term_ref_pic_set_sps_flag == 0 h-sh.short_term_rps) { -pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-num_delta_pocs; +pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-rps_idx_num_delta_pocs; pp-wNumBitsForShortTermRPSInSlice = h-sh.short_term_ref_pic_set_size; } diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index 2c1aff7..32d6da9 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -276,6 +276,7 @@ enum ScanType { typedef struct ShortTermRPS { unsigned int num_negative_pics; int num_delta_pocs; +int rps_idx_num_delta_pocs; int32_t delta_poc[32]; uint8_t used[32]; } ShortTermRPS; diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index d507c9b..427cf09 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -136,6 +136,7 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx, return AVERROR_INVALIDDATA; } rps_ridx = sps-st_rps[sps-nb_st_rps - delta_idx]; +rps-rps_idx_num_delta_pocs = rps_ridx-num_delta_pocs; } else rps_ridx = sps-st_rps[rps - sps-st_rps - 1]; -- 1.9.5.msysgit.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] dxva2_hevc: fix ucNumDeltaPocsOfRefRpsIdx
Hi, On Sun, Aug 2, 2015 at 7:10 AM, Hendrik Leppkes h.lepp...@gmail.com wrote: On Sun, Aug 2, 2015 at 1:07 PM, Hendrik Leppkes h.lepp...@gmail.com wrote: It needs to point to the value from the sps rps, not the final computed one from the slice header. --- libavcodec/dxva2_hevc.c | 2 +- libavcodec/hevc.h | 1 + libavcodec/hevc_ps.c| 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 7e39677..79d2d28 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -92,7 +92,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext * pp-init_qp_minus26 = pps-pic_init_qp_minus26; if (h-sh.short_term_ref_pic_set_sps_flag == 0 h-sh.short_term_rps) { -pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-num_delta_pocs; +pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-rps_idx_num_delta_pocs; pp-wNumBitsForShortTermRPSInSlice = h-sh.short_term_ref_pic_set_size; } diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index 2c1aff7..32d6da9 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -276,6 +276,7 @@ enum ScanType { typedef struct ShortTermRPS { unsigned int num_negative_pics; int num_delta_pocs; +int rps_idx_num_delta_pocs; int32_t delta_poc[32]; uint8_t used[32]; } ShortTermRPS; diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index d507c9b..427cf09 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -136,6 +136,7 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx, return AVERROR_INVALIDDATA; } rps_ridx = sps-st_rps[sps-nb_st_rps - delta_idx]; +rps-rps_idx_num_delta_pocs = rps_ridx-num_delta_pocs; } else rps_ridx = sps-st_rps[rps - sps-st_rps - 1]; -- Forgot to put this into the commit message, but it fixes this sample: http://trailers.divx.com/hevc/Sintel_4k_27qp_24fps_1aud_9subs.mkv Makes sense, lgtm. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] dxva2_hevc: fix ucNumDeltaPocsOfRefRpsIdx
On Sun, 2 Aug 2015 13:07:31 +0200 Hendrik Leppkes h.lepp...@gmail.com wrote: It needs to point to the value from the sps rps, not the final computed one from the slice header. --- it looks ok to me, but i did not review code. i would use the ^^ above as a commit message though. maybe something like dxva2_hevc: get pocs from sps rps index instead of slice header dxva2_hevc: fix ucNumDeltaPocsOfRefRpsIdx is kind of not helpful. -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
Hello All, The attached patch adds QSV-based mjpeg video decoder. Please review. -- Best regards, Ivan mailto:ivan.us...@nablet.com 0001-QSV-MJPEG-video-decoder-has-been-added.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mov: Support alac extradata in wave atom
On 8/1/15, Carl Eugen Hoyos ceho...@ag.or.at wrote: Hi! Attached patch fixes ticket #4747 for me, I don't know how to detect that the wave atom contains no frma / alac atom... And that is mentioned because? Please comment, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] dxva2_hevc: fix ucNumDeltaPocsOfRefRpsIdx
On Sun, Aug 2, 2015 at 1:07 PM, Hendrik Leppkes h.lepp...@gmail.com wrote: It needs to point to the value from the sps rps, not the final computed one from the slice header. --- libavcodec/dxva2_hevc.c | 2 +- libavcodec/hevc.h | 1 + libavcodec/hevc_ps.c| 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 7e39677..79d2d28 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -92,7 +92,7 @@ static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext * pp-init_qp_minus26 = pps-pic_init_qp_minus26; if (h-sh.short_term_ref_pic_set_sps_flag == 0 h-sh.short_term_rps) { -pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-num_delta_pocs; +pp-ucNumDeltaPocsOfRefRpsIdx= h-sh.short_term_rps-rps_idx_num_delta_pocs; pp-wNumBitsForShortTermRPSInSlice = h-sh.short_term_ref_pic_set_size; } diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index 2c1aff7..32d6da9 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -276,6 +276,7 @@ enum ScanType { typedef struct ShortTermRPS { unsigned int num_negative_pics; int num_delta_pocs; +int rps_idx_num_delta_pocs; int32_t delta_poc[32]; uint8_t used[32]; } ShortTermRPS; diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index d507c9b..427cf09 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -136,6 +136,7 @@ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx, return AVERROR_INVALIDDATA; } rps_ridx = sps-st_rps[sps-nb_st_rps - delta_idx]; +rps-rps_idx_num_delta_pocs = rps_ridx-num_delta_pocs; } else rps_ridx = sps-st_rps[rps - sps-st_rps - 1]; -- Forgot to put this into the commit message, but it fixes this sample: http://trailers.divx.com/hevc/Sintel_4k_27qp_24fps_1aud_9subs.mkv - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, Aug 02, 2015 at 03:31:07PM +0300, Ivan Uskov wrote: Hello All, The attached patch adds QSV-based mjpeg video decoder. Please review. -- Best regards, Ivan mailto:ivan.us...@nablet.com Changelog |1 configure |4 ++ libavcodec/Makefile |1 libavcodec/allcodecs.c|2 + libavcodec/qsv.c | 10 - libavcodec/qsvdec_mjpeg.c | 88 ++ libavcodec/version.h |4 +- 7 files changed, 107 insertions(+), 3 deletions(-) bb73d75e397cda2dc536765bdeb6dde07cf59458 0001-QSV-MJPEG-video-decoder-has-been-added.patch From a9fef261b1498a8945c1f81e08f226ead4e176fd Mon Sep 17 00:00:00 2001 From: Ivan Uskov ivan.us...@nablet.com Date: Sun, 2 Aug 2015 08:19:28 -0400 Subject: [PATCH] QSV MJPEG video decoder has been added. --- Changelog | 1 + configure | 4 +++ libavcodec/Makefile | 1 + libavcodec/allcodecs.c| 2 ++ libavcodec/qsv.c | 10 +- libavcodec/qsvdec_mjpeg.c | 88 +++ libavcodec/version.h | 4 +-- 7 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 libavcodec/qsvdec_mjpeg.c diff --git a/Changelog b/Changelog index f41d837..0002281 100644 --- a/Changelog +++ b/Changelog @@ -17,6 +17,7 @@ version next: - Intel QSV-accelerated MPEG-2 video and HEVC encoding - Intel QSV-accelerated MPEG-2 video and HEVC decoding - Intel QSV-accelerated VC-1 video decoding +- Intel QSV-accelerated MJPEG video decoding - libkvazaar HEVC encoder - erosion, dilation, deflate and inflate video filters - Dynamic Audio Normalizer as dynaudnorm filter diff --git a/configure b/configure index f3550a0..6f5d3c8 100755 --- a/configure +++ b/configure @@ -2254,6 +2254,8 @@ mimic_decoder_select=blockdsp bswapdsp hpeldsp idctdsp mjpeg_decoder_select=blockdsp hpeldsp exif idctdsp jpegtables mjpeg_encoder_select=aandcttables jpegtables mpegvideoenc mjpegb_decoder_select=mjpeg_decoder +mjpeg_qsv_decoder_deps=libmfx +mjpeg_qsv_decoder_select=qsvdec mjpeg_qsv_hwaccel mlp_decoder_select=mlp_parser motionpixels_decoder_select=bswapdsp mp1_decoder_select=mpegaudio @@ -2417,6 +2419,8 @@ hevc_dxva2_hwaccel_select=hevc_decoder hevc_qsv_hwaccel_deps=libmfx hevc_vdpau_hwaccel_deps=vdpau VdpPictureInfoHEVC hevc_vdpau_hwaccel_select=hevc_decoder +mjpeg_qsv_hwaccel_deps=libmfx +mjpeg_qsv_hwaccel_select=qsvdec_mjpeg mpeg_vdpau_decoder_deps=vdpau mpeg_vdpau_decoder_select=mpeg2video_decoder mpeg_xvmc_hwaccel_deps=xvmc diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7cf2403..00cfca7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -338,6 +338,7 @@ OBJS-$(CONFIG_MIMIC_DECODER) += mimic.o OBJS-$(CONFIG_MJPEG_DECODER) += mjpegdec.o OBJS-$(CONFIG_MJPEG_ENCODER) += mjpegenc.o mjpegenc_common.o OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o +OBJS-$(CONFIG_MJPEG_QSV_DECODER) += qsvdec_mjpeg.o OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o OBJS-$(CONFIG_MOTIONPIXELS_DECODER)+= motionpixels.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 417f824..6177933 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -88,6 +88,7 @@ void avcodec_register_all(void) REGISTER_HWACCEL(HEVC_DXVA2,hevc_dxva2); REGISTER_HWACCEL(HEVC_QSV, hevc_qsv); REGISTER_HWACCEL(HEVC_VDPAU,hevc_vdpau); +REGISTER_HWACCEL(MJPEG_QSV, mjpeg_qsv); REGISTER_HWACCEL(MPEG1_XVMC,mpeg1_xvmc); REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau); REGISTER_HWACCEL(MPEG2_XVMC,mpeg2_xvmc); @@ -213,6 +214,7 @@ void avcodec_register_all(void) REGISTER_DECODER(MIMIC, mimic); REGISTER_ENCDEC (MJPEG, mjpeg); REGISTER_DECODER(MJPEGB,mjpegb); +REGISTER_DECODER(MJPEG_QSV, mjpeg_qsv); REGISTER_DECODER(MMVIDEO, mmvideo); REGISTER_DECODER(MOTIONPIXELS, motionpixels); #if FF_API_XVMC diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 4c8e6b0..0f5c9ce 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -20,7 +20,6 @@ #include mfx/mfxvideo.h #include mfx/mfxplugin.h - #include stdio.h #include string.h @@ -30,6 +29,11 @@ #include avcodec.h #include qsv_internal.h +#if QSV_VERSION_ATLEAST(1, 3) +#include mfx/mfxjpeg.h +#endif this seems not working CC libavcodec/qsv.o libavcodec/qsv.c:33:25: fatal error: mfx/mfxjpeg.h: No such file or directory #include mfx/mfxjpeg.h ^ compilation terminated. common.mak:57: recipe for target 'libavcodec/qsv.o' failed make: *** [libavcodec/qsv.o] Error 1
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
Hello wm4, Sunday, August 2, 2015, 9:27:17 PM, you wrote: w Is mjpeg decoding so important that we need QSV decoding of it? Why not? It is for free. -- Best regards, Ivanmailto:ivan.us...@nablet.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter: add framerate video filter
On 7/24/15, Michael Niedermayer mich...@niedermayer.cc wrote: On Fri, Jul 24, 2015 at 07:09:16AM +, Paul B Mahol wrote: [..] +static av_cold void uninit(AVFilterContext *ctx) +{ +FrameRateContext *s = ctx-priv; +int i; + +for (i = s-frst + 1; i s-last; i++) { +if (s-srce[i] (s-srce[i] != s-srce[i + 1])) +av_frame_free(s-srce[i]); +} +av_frame_free(s-srce[s-last]); +} + +static int query_formats(AVFilterContext *ctx) +{ +static const enum PixelFormat pix_fmts[] = { AVPixelFormat Will replace. +PIX_FMT_YUV410P, +PIX_FMT_YUV411P, +PIX_FMT_YUV420P, +PIX_FMT_YUV422P, +PIX_FMT_YUV440P, +PIX_FMT_YUV444P, +PIX_FMT_NONE AV_PIX_FMT_* Will replace. +}; + +AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); +if (!fmts_list) +return AVERROR(ENOMEM); +return ff_set_common_formats(ctx, fmts_list); +} + +static int config_input(AVFilterLink *inlink) +{ +AVFilterContext *ctx = inlink-dst; +FrameRateContext *s = ctx-priv; +const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink-format); +int plane; + +/** full an array with the number of bytes that the video + * data occupies per line for each plane of the input video */ +for (plane = 0; plane 4; plane++) { doxygen comment in the middle looks a bit odd Will remove. +s-line_size[plane] = av_image_get_linesize( +inlink-format, +inlink-w, +plane); +} + +s-vsub = pix_desc-log2_chroma_h; + +s-sad = av_pixelutils_get_sad_fn(3, 3, 2, s); // 8x8 both sources aligned +if (!s-sad) +return AVERROR(EINVAL); + +s-srce_time_base = inlink-time_base; + +return 0; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) +{ +AVFilterContext *ctx = inlink-dst; +FrameRateContext *s = ctx-priv; +AVFilterLink *outlink = ctx-outputs[0]; + +// we have one new frame +s-pending_srce_frames++; + +if (inpicref-interlaced_frame) +av_log(ctx, AV_LOG_WARNING, Interlaced frame found - the output will not be correct\n); + +// store the pointer to the new frame +av_frame_free(s-srce[s-frst]); +s-srce[s-frst] = inpicref; + +if (!s-pending_end_frame s-srce[s-crnt]) { +s-work = ff_get_video_buffer(outlink, outlink-w, outlink-h); +av_frame_copy_props(s-work, s-srce[s-crnt]); +set_work_frame_pts(ctx); + +s-pending_end_frame = 1; +} else { +set_srce_frame_dest_pts(ctx); +} + +//if (!s-srce[s-crnt]) { +//av_dlog(ctx, end_frame() no current frame\n); +//return; +//} the patch contains several outcomented pieces of code, is that intended ? I can remove them if they seems to not be wanted. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not know. -- Lao Tsu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
Hello Michael, Sunday, August 2, 2015, 8:55:45 PM, you wrote: +#if QSV_VERSION_ATLEAST(1, 3) +#include mfx/mfxjpeg.h +#endif MN this seems not working MN CC libavcodec/qsv.o MN libavcodec/qsv.c:33:25: fatal error: mfx/mfxjpeg.h: No such file or directory MN #include mfx/mfxjpeg.h MN ^ MN compilation terminated. MN common.mak:57: recipe for target 'libavcodec/qsv.o' failed MN make: *** [libavcodec/qsv.o] Error 1 MN /usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MAJOR 1 MN /usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MINOR 10 MN /usr/local/include/mfxvideo.h:#define MFX_VERSION_MAJOR 1 MN /usr/local/include/mfxvideo.h:#define MFX_VERSION_MINOR 10 MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? As more simple variant, may be just change a condition for mfx/mfxjpeg.h to QSV_VERSION_ATLEAST(1, 16) ? Then it should work at least with latest mfx_dispatch and intel sdk too. -- Best regards, Ivanmailto:ivan.us...@nablet.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, 2 Aug 2015 15:31:07 +0300 Ivan Uskov ivan.us...@nablet.com wrote: Hello All, The attached patch adds QSV-based mjpeg video decoder. Please review. Is mjpeg decoding so important that we need QSV decoding of it? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
Hello wm4, Sunday, August 2, 2015, 9:38:33 PM, you wrote: w Is mjpeg decoding so important that we need QSV decoding of it? Why not? It is for free. w Having to maintain additional code has a cost, though. Near about zero, since qsv core common for all formats. -- Best regards, Ivanmailto:ivan.us...@nablet.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, Aug 02, 2015 at 09:23:21PM +0300, Ivan Uskov wrote: Hello Michael, Sunday, August 2, 2015, 8:55:45 PM, you wrote: +#if QSV_VERSION_ATLEAST(1, 3) +#include mfx/mfxjpeg.h +#endif MN this seems not working MN CC libavcodec/qsv.o MN libavcodec/qsv.c:33:25: fatal error: mfx/mfxjpeg.h: No such file or directory MN #include mfx/mfxjpeg.h MN ^ MN compilation terminated. MN common.mak:57: recipe for target 'libavcodec/qsv.o' failed MN make: *** [libavcodec/qsv.o] Error 1 MN /usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MAJOR 1 MN /usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MINOR 10 MN /usr/local/include/mfxvideo.h:#define MFX_VERSION_MAJOR 1 MN /usr/local/include/mfxvideo.h:#define MFX_VERSION_MINOR 10 MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? its very simple, see any code using check_header and related functions in configure and HAVE_*_H defines [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, 2 Aug 2015 20:27:17 +0200 wm4 nfx...@googlemail.com wrote: On Sun, 2 Aug 2015 15:31:07 +0300 Ivan Uskov ivan.us...@nablet.com wrote: Hello All, The attached patch adds QSV-based mjpeg video decoder. Please review. Is mjpeg decoding so important that we need QSV decoding of it? some ip video cameras do mjpeg (others do jp2k or h264 of course), could use this to pipe to h264 encoder? dunno. -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter: add framerate video filter
On Sun, Aug 02, 2015 at 06:57:15PM +0200, Paul B Mahol wrote: On 7/24/15, Michael Niedermayer mich...@niedermayer.cc wrote: On Fri, Jul 24, 2015 at 07:09:16AM +, Paul B Mahol wrote: [...] +static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) +{ +AVFilterContext *ctx = inlink-dst; +FrameRateContext *s = ctx-priv; +AVFilterLink *outlink = ctx-outputs[0]; + +// we have one new frame +s-pending_srce_frames++; + +if (inpicref-interlaced_frame) +av_log(ctx, AV_LOG_WARNING, Interlaced frame found - the output will not be correct\n); + +// store the pointer to the new frame +av_frame_free(s-srce[s-frst]); +s-srce[s-frst] = inpicref; + +if (!s-pending_end_frame s-srce[s-crnt]) { +s-work = ff_get_video_buffer(outlink, outlink-w, outlink-h); +av_frame_copy_props(s-work, s-srce[s-crnt]); +set_work_frame_pts(ctx); + +s-pending_end_frame = 1; +} else { +set_srce_frame_dest_pts(ctx); +} + +//if (!s-srce[s-crnt]) { +//av_dlog(ctx, end_frame() no current frame\n); +//return; +//} the patch contains several outcomented pieces of code, is that intended ? I can remove them if they seems to not be wanted. ive no oppinion on them being wanted or not, just noticed them and wondered [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, 2 Aug 2015 21:36:15 +0300 Ivan Uskov ivan.us...@nablet.com wrote: Hello wm4, Sunday, August 2, 2015, 9:27:17 PM, you wrote: w Is mjpeg decoding so important that we need QSV decoding of it? Why not? It is for free. Having to maintain additional code has a cost, though. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v6] Add support for Audible AA files
02.08.2015, 07:44, James Almer jamr...@gmail.com: On 30/07/15 7:46 AM, Vesselin Bontchev wrote: From 06b0c0013404a67c72ea14a3c90730c0c4bd5b9a Mon Sep 17 00:00:00 2001 From: Vesselin Bontchev vesselin.bontc...@yandex.com Date: Sun, 19 Jul 2015 23:16:36 +0200 Subject: [PATCH] Add support for Audible AA files + AVIOContext *pb = s-pb; + AVStream *st = avformat_new_stream(s, NULL); + if (!st) + return AVERROR(ENOMEM); + c-tea_ctx = av_tea_alloc(); You could move this below right before tea_init and replace all of the gotos below with simple returns. Thanks, this really makes the code look better! :) + /* verify fixed key */ + if (c-aa_fixed_key_size != 16) { This is zeroed during init but apparently never touched after that. You should probably check the length of the AVOption aa_fixed_key instead. http://ffmpeg.org/doxygen/trunk/group__avoptions.html seems to say that this field is automatically updated (and in practice it does get updated according to what you pass in). +static const AVOption aa_options[] = { + { aa_fixed_key, // extracted from libAAX_SDK.so and AAXSDKWin.dll files! + Fixed key used for handling Audible AA files, OFFSET(aa_fixed_key), + AV_OPT_TYPE_BINARY, {.str=77214d4b196a87cd520045fd2a51d673}, This should probably be AV_OPT_TYPE_STRING. We want to hex decode the value of aa_fixed_key. So, AV_OPT_TYPE_BINARY seems to be appropriate. I have incorporated rest of your feedback into a new revision of the patch, thanks! Vesselin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avfilter: add convolution filter
Signed-off-by: Paul B Mahol one...@gmail.com --- doc/filters.texi | 61 libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_convolution.c | 337 +++ 4 files changed, 400 insertions(+) create mode 100644 libavfilter/vf_convolution.c diff --git a/doc/filters.texi b/doc/filters.texi index f20f68b..96eb8b5 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3577,6 +3577,67 @@ For example to convert from BT.601 to SMPTE-240M, use the command: colormatrix=bt601:smpte240m @end example +@section convolution + +Apply convolution 3x3 or 5x5 filter. + +The filter accepts the following options: + +@table @option +@item 0m +@item 1m +@item 2m +@item 3m +Set matrix for each plane. +Matrix is sequence of 9 or 25 signed integers. + +@item 0rdiv +@item 1rdiv +@item 2rdiv +@item 3rdiv +Set multiplicator for calculated value for each plane. + +@item 0bias +@item 1bias +@item 2bias +@item 3bias +Set bias for each plane. This value is added to result of above multiplication. +@end table + +@subsection Examples + +@itemize +@item +Apply sharpen: +@example +convolution=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0 +@end example + +@item +Apply blur: +@example +convolution=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9 +@end example + +@item +Apply edge enhance: +@example +convolution=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128 +@end example + +@item +Apply edge detect: +@example +convolution=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128 +@end example + +@item +Apply emboss: +@example +convolution=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2 +@end example +@end itemize + @section copy Copy the input source unchanged to the output. This is mainly useful for diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 72260d5..e8d9c18 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -109,6 +109,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o +OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 1bcfa7b..d2f0619 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -125,6 +125,7 @@ void avfilter_register_all(void) REGISTER_FILTER(COLORKEY, colorkey, vf); REGISTER_FILTER(COLORLEVELS,colorlevels,vf); REGISTER_FILTER(COLORMATRIX,colormatrix,vf); +REGISTER_FILTER(CONVOLUTION,convolution,vf); REGISTER_FILTER(COPY, copy, vf); REGISTER_FILTER(COVER_RECT, cover_rect, vf); REGISTER_FILTER(CROP, crop, vf); diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c new file mode 100644 index 000..dcc7b9f --- /dev/null +++ b/libavfilter/vf_convolution.c @@ -0,0 +1,337 @@ +/* + * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com) + * Copyright (c) 2015 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include libavutil/avstring.h +#include libavutil/imgutils.h +#include libavutil/opt.h +#include libavutil/pixdesc.h +#include avfilter.h +#include formats.h +#include internal.h +#include video.h + +typedef struct ConvolutionContext { +const AVClass *class; + +char *matrix_str[4]; +float rdiv[4]; +float bias[4]; + +int bstride; +uint8_t *buffer; +int nb_planes; +int planewidth[4]; +int planeheight[4]; +int matrix[4][25]; +int matrix_length[4]; +int copy[4]; + +void (*filter[4])(struct ConvolutionContext *s, AVFrame *in, AVFrame *out, int
[FFmpeg-devel] [PATCH 0/4] x86inc: Sync changes from x264
This brings x86inc.asm in libavutil up to date with x86inc.asm in x264. They're not 100% identical but the difference is tiny compared to before. Henrik Gramner (4): x86inc: Support arbitrary stack alignments x86inc: Disable vpbroadcastq workaround in newer yasm versions x86inc: Drop SECTION_TEXT macro x86inc: Various minor backports from x264 libavcodec/x86/aacpsdsp.asm | 2 +- libavcodec/x86/audiodsp.asm | 2 +- libavcodec/x86/blockdsp.asm | 2 +- libavcodec/x86/bswapdsp.asm | 2 +- libavcodec/x86/dcadsp.asm| 2 +- libavcodec/x86/dct32.asm | 2 +- libavcodec/x86/fft.asm | 2 +- libavcodec/x86/flac_dsp_gpl.asm | 2 +- libavcodec/x86/fmtconvert.asm| 2 +- libavcodec/x86/g722dsp.asm | 2 +- libavcodec/x86/h263_loopfilter.asm | 2 +- libavcodec/x86/h264_deblock.asm | 4 +- libavcodec/x86/hevc_idct.asm | 2 +- libavcodec/x86/hevc_mc.asm | 3 +- libavcodec/x86/hevc_sao.asm | 2 +- libavcodec/x86/hpeldsp.asm | 2 +- libavcodec/x86/huffyuvdsp.asm| 2 +- libavcodec/x86/idctdsp.asm | 2 +- libavcodec/x86/imdct36.asm | 2 +- libavcodec/x86/lossless_audiodsp.asm | 2 +- libavcodec/x86/lossless_videodsp.asm | 2 +- libavcodec/x86/mlpdsp.asm| 2 +- libavcodec/x86/pngdsp.asm| 2 +- libavcodec/x86/qpeldsp.asm | 2 +- libavcodec/x86/sbrdsp.asm| 2 +- libavcodec/x86/svq1enc.asm | 2 +- libavfilter/x86/af_volume.asm| 2 +- libavfilter/x86/vf_idet.asm | 2 +- libavfilter/x86/vf_pullup.asm| 2 +- libavfilter/x86/vf_removegrain.asm | 2 +- libavresample/x86/audio_convert.asm | 2 +- libavresample/x86/audio_mix.asm | 2 +- libavresample/x86/dither.asm | 2 +- libavutil/x86/pixelutils.asm | 2 +- libavutil/x86/x86inc.asm | 126 --- 35 files changed, 108 insertions(+), 89 deletions(-) -- 1.8.3.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] x86inc: Various minor backports from x264
--- libavutil/x86/x86inc.asm | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 49b4107..8dfc24f 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -1,7 +1,7 @@ ;* ;* x86inc.asm: x264asm abstraction layer ;* -;* Copyright (C) 2005-2013 x264 project +;* Copyright (C) 2005-2015 x264 project ;* ;* Authors: Loren Merritt lor...@u.washington.edu ;* Anton Mitrofanov bugmas...@narod.ru @@ -67,6 +67,15 @@ %endif %endif +%define FORMAT_ELF 0 +%ifidn __OUTPUT_FORMAT__,elf +%define FORMAT_ELF 1 +%elifidn __OUTPUT_FORMAT__,elf32 +%define FORMAT_ELF 1 +%elifidn __OUTPUT_FORMAT__,elf64 +%define FORMAT_ELF 1 +%endif + %ifdef PREFIX %define mangle(x) _ %+ x %else @@ -688,7 +697,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, CAT_XDEFINE cglobaled_, %2, 1 %endif %xdefine current_function %2 -%ifidn __OUTPUT_FORMAT__,elf +%if FORMAT_ELF global %2:function %%VISIBILITY %else global %2 @@ -714,14 +723,16 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, ; like cextern, but without the prefix %macro cextern_naked 1 -%xdefine %1 mangle(%1) +%ifdef PREFIX +%xdefine %1 mangle(%1) +%endif CAT_XDEFINE cglobaled_, %1, 1 extern %1 %endmacro %macro const 1-2+ %xdefine %1 mangle(private_prefix %+ _ %+ %1) -%ifidn __OUTPUT_FORMAT__,elf +%if FORMAT_ELF global %1:data hidden %else global %1 @@ -729,10 +740,9 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, %1: %2 %endmacro -; This is needed for ELF, otherwise the GNU linker assumes the stack is -; executable by default. -%ifidn __OUTPUT_FORMAT__,elf -[section .note.GNU-stack noalloc noexec nowrite progbits] +; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default. +%if FORMAT_ELF +[SECTION .note.GNU-stack noalloc noexec nowrite progbits] %endif ; cpuflags @@ -751,8 +761,8 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, %assign cpuflags_avx (111)| cpuflags_sse42 %assign cpuflags_xop (112)| cpuflags_avx %assign cpuflags_fma4 (113)| cpuflags_avx -%assign cpuflags_avx2 (114)| cpuflags_avx -%assign cpuflags_fma3 (115)| cpuflags_avx +%assign cpuflags_fma3 (114)| cpuflags_avx +%assign cpuflags_avx2 (115)| cpuflags_fma3 %assign cpuflags_cache32 (116) %assign cpuflags_cache64 (117) @@ -801,7 +811,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae, %endif %endif -%if cpuflag(sse2) +%if ARCH_X86_64 || cpuflag(sse2) CPUNOP amdnop %else CPUNOP basicnop -- 1.8.3.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] x86inc: Drop SECTION_TEXT macro
The .text section is already 16-byte aligned by default on all supported platforms so `SECTION_TEXT` isn't any different from `SECTION .text`. --- libavcodec/x86/aacpsdsp.asm | 2 +- libavcodec/x86/audiodsp.asm | 2 +- libavcodec/x86/blockdsp.asm | 2 +- libavcodec/x86/bswapdsp.asm | 2 +- libavcodec/x86/dcadsp.asm| 2 +- libavcodec/x86/dct32.asm | 2 +- libavcodec/x86/fft.asm | 2 +- libavcodec/x86/flac_dsp_gpl.asm | 2 +- libavcodec/x86/fmtconvert.asm| 2 +- libavcodec/x86/g722dsp.asm | 2 +- libavcodec/x86/h263_loopfilter.asm | 2 +- libavcodec/x86/hevc_idct.asm | 2 +- libavcodec/x86/hevc_mc.asm | 3 ++- libavcodec/x86/hevc_sao.asm | 2 +- libavcodec/x86/hpeldsp.asm | 2 +- libavcodec/x86/huffyuvdsp.asm| 2 +- libavcodec/x86/idctdsp.asm | 2 +- libavcodec/x86/imdct36.asm | 2 +- libavcodec/x86/lossless_audiodsp.asm | 2 +- libavcodec/x86/lossless_videodsp.asm | 2 +- libavcodec/x86/mlpdsp.asm| 2 +- libavcodec/x86/pngdsp.asm| 2 +- libavcodec/x86/qpeldsp.asm | 2 +- libavcodec/x86/sbrdsp.asm| 2 +- libavcodec/x86/svq1enc.asm | 2 +- libavfilter/x86/af_volume.asm| 2 +- libavfilter/x86/vf_idet.asm | 2 +- libavfilter/x86/vf_pullup.asm| 2 +- libavfilter/x86/vf_removegrain.asm | 2 +- libavresample/x86/audio_convert.asm | 2 +- libavresample/x86/audio_mix.asm | 2 +- libavresample/x86/dither.asm | 2 +- libavutil/x86/pixelutils.asm | 2 +- libavutil/x86/x86inc.asm | 12 34 files changed, 34 insertions(+), 45 deletions(-) diff --git a/libavcodec/x86/aacpsdsp.asm b/libavcodec/x86/aacpsdsp.asm index d4dfd5b..d1187df 100644 --- a/libavcodec/x86/aacpsdsp.asm +++ b/libavcodec/x86/aacpsdsp.asm @@ -26,7 +26,7 @@ SECTION_RODATA ps_p1m1p1m1: dd 0, 0x8000, 0, 0x8000 -SECTION_TEXT +SECTION .text ;* ;void ff_ps_add_squares_opt(float *dst, const float (*src)[2], int n); diff --git a/libavcodec/x86/audiodsp.asm b/libavcodec/x86/audiodsp.asm index 273b9ef..3ffb27f 100644 --- a/libavcodec/x86/audiodsp.asm +++ b/libavcodec/x86/audiodsp.asm @@ -21,7 +21,7 @@ %include libavutil/x86/x86util.asm -SECTION_TEXT +SECTION .text %macro SCALARPRODUCT 0 ; int ff_scalarproduct_int16(int16_t *v1, int16_t *v2, int order) diff --git a/libavcodec/x86/blockdsp.asm b/libavcodec/x86/blockdsp.asm index af2b0de..7cbfa3a 100644 --- a/libavcodec/x86/blockdsp.asm +++ b/libavcodec/x86/blockdsp.asm @@ -23,7 +23,7 @@ %include libavutil/x86/x86util.asm -SECTION_TEXT +SECTION .text ; ; void ff_clear_block(int16_t *blocks); diff --git a/libavcodec/x86/bswapdsp.asm b/libavcodec/x86/bswapdsp.asm index b2d749c..56d8083 100644 --- a/libavcodec/x86/bswapdsp.asm +++ b/libavcodec/x86/bswapdsp.asm @@ -28,7 +28,7 @@ pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 cextern pb_80 -SECTION_TEXT +SECTION .text ; %1 = aligned/unaligned %macro BSWAP_LOOPS 1 diff --git a/libavcodec/x86/dcadsp.asm b/libavcodec/x86/dcadsp.asm index 030b4d4..548cec1 100644 --- a/libavcodec/x86/dcadsp.asm +++ b/libavcodec/x86/dcadsp.asm @@ -24,7 +24,7 @@ SECTION_RODATA pf_inv16: times 4 dd 0x3D80 ; 1/16 -SECTION_TEXT +SECTION .text ; void decode_hf(float dst[DCA_SUBBANDS][8], const int32_t vq_num[DCA_SUBBANDS], ;const int8_t hf_vq[1024][32], intptr_t vq_offset, diff --git a/libavcodec/x86/dct32.asm b/libavcodec/x86/dct32.asm index 3e37812..4e657b5 100644 --- a/libavcodec/x86/dct32.asm +++ b/libavcodec/x86/dct32.asm @@ -191,7 +191,7 @@ ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000, 0, 0, 0x8000, 0x8000 %endmacro INIT_YMM avx -SECTION_TEXT +SECTION .text %if HAVE_AVX_EXTERNAL ; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in) cglobal dct32_float, 2,3,8, out, in, tmp diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm index f233774..22d9866 100644 --- a/libavcodec/x86/fft.asm +++ b/libavcodec/x86/fft.asm @@ -90,7 +90,7 @@ cextern cos_ %+ i %1 %endmacro -SECTION_TEXT +SECTION .text %macro T2_3DNOW 4 ; z0, z1, mem0, mem1 mova %1, %3 diff --git a/libavcodec/x86/flac_dsp_gpl.asm b/libavcodec/x86/flac_dsp_gpl.asm index cedf083..e285158 100644 --- a/libavcodec/x86/flac_dsp_gpl.asm +++ b/libavcodec/x86/flac_dsp_gpl.asm @@ -22,7 +22,7 @@ %include libavutil/x86/x86util.asm -SECTION_TEXT +SECTION .text INIT_XMM sse4 %if ARCH_X86_64 diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm index f4fc0c2..20d8315 100644 --- a/libavcodec/x86/fmtconvert.asm +++ b/libavcodec/x86/fmtconvert.asm @@ -21,7 +21,7 @@ %include libavutil/x86/x86util.asm -SECTION_TEXT +SECTION .text
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, Aug 2, 2015 at 11:52 PM, wm4 nfx...@googlemail.com wrote: On Sun, 2 Aug 2015 23:45:36 +0200 Hendrik Leppkes h.lepp...@gmail.com wrote: On Sun, Aug 2, 2015 at 11:27 PM, Ivan Uskov ivan.us...@nablet.com wrote: Hello Michael, Sunday, August 2, 2015, 9:46:23 PM, you wrote: MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? MN its very simple, see any code using check_header and related functions MN in configure MN and HAVE_*_H defines MN [...] I have added simple check for mfxjpeg.h to configure, please review the attached update. The decoder should depend on the header in configure directly already, so its not built at all when the header is not available. Secondly, why is there a AVHWAccel in there? It doesn't have any callable functions, nor do we support AVHWAccel for mjpeg. For some reason the other QSV codecs also have this, but also without any functions in them - those serve no purpose and are likely to even cause problems if a user accidentally tries to use it. I'll send a patch to remove them, unless you can name a reason for them to exist. Because if it's missing, ff_get_format() refuses to return the QSV opaque format. I think. So you need AVHWAccels for every codec/decoder combination. But if you use the normal h264 decoder and select the QSV format in get_format (because you don't know any better), it will probably end up in unhappiness of all. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, Aug 2, 2015 at 11:27 PM, Ivan Uskov ivan.us...@nablet.com wrote: Hello Michael, Sunday, August 2, 2015, 9:46:23 PM, you wrote: MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? MN its very simple, see any code using check_header and related functions MN in configure MN and HAVE_*_H defines MN [...] I have added simple check for mfxjpeg.h to configure, please review the attached update. The decoder should depend on the header in configure directly already, so its not built at all when the header is not available. Secondly, why is there a AVHWAccel in there? It doesn't have any callable functions, nor do we support AVHWAccel for mjpeg. For some reason the other QSV codecs also have this, but also without any functions in them - those serve no purpose and are likely to even cause problems if a user accidentally tries to use it. I'll send a patch to remove them, unless you can name a reason for them to exist. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
Hello Michael, Sunday, August 2, 2015, 9:46:23 PM, you wrote: MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? MN its very simple, see any code using check_header and related functions MN in configure MN and HAVE_*_H defines MN [...] I have added simple check for mfxjpeg.h to configure, please review the attached update. -- Best regards, Ivanmailto:ivan.us...@nablet.com 0001-QSV-MJPEG-video-decoder-has-been-added.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] FFmpegs future and resigning as leader
On date Friday 2015-07-31 15:53:04 +0200, Michael Niedermayer wrote: Hi all Ive been in FFmepg since 14 years and been the leader since 11 years and i feel that iam not the best person for the leader position. I had hoped for a long time that the fork situation would resolve and both sides somehow merging back into one team. All the Libav developers joining FFmpeg again. But even now as the last distributions are preparing to remove Libav, still theres no hint of that happening. Maybe even the opposite. The community is split and its very difficult to be the leader when one is on one side of this split and the other tries everything to push me out I hope my resignation will make it easier for the teams to find back together and avoid a more complete split which would otherwise be the result sooner or later as the trees diverge and merging all improvments becomes too difficult for me to do. also before my resignation, i offer all maintainers who dont yet have, direct write access as i likely will not comb through the ML anymore or not as frequently to apply patches, please send me your public SSH key if you are de facto maintaining or working on some part of FFmpeg or are listed in MAINTAINERs. If people want to continue merges from libav, someone else will have to do these. Indeed i fully admit the work and pressure caused by the merges is a main reason for my resignation. FFmpeg belongs to the FFmpeg developers and the FFmpeg community! will i ever return ? ... i might ..., if theres a nice and friendly environment, no hostile forks or at least none i have to interact with. But i will certainly not return as leader, this is not really a role i ever truly liked, more one i ended up with. Especially as somehow leader is being interpreted by everyone as the guy who does all work noone else does, and takes all responsibility noone else wants to take I want to thank you for all the impressive work you've done so far, if you decided this abruptly it's probably time for you to release the burden and enjoy some relax and pursue other objectives and interests in your life. I only hoped that you would have done this in a more progressive way, leaving involved people to realize what to do next after your resignation. Indeed you've been by far the most important person in the project for several years, and now that you resign the project and will probably change deeply, for better or for worse. On the other hand I understand that if you decided to resign this way, you have your good reasons, and I accept this, and this abruptness will probably solicit more energic action from all the involved contributors. Indeed, your major involvement in so many areas of the project was one of its current main vulnerabilities, since it depended on a single person. Now I'm curious to see how the community around the project will cope with it and if the project will be able to recover. About the the guy who does all work noone else does, and takes all responsibility noone else wants to take I can understand this very well, and I understand how taking this role of leadership, especially in a voluntary based project, and having to cope with all the critics which comes from that, can be exhausting and overwhelming, and I was concerned more than one time about how you was personally able to cope with that. Dealing with such a role is not easy, and you deserve all the respect for being able to keep the burden for so much time. I understand that taking all these responsabilities can be an attractor for scorn and contempt, since people tend to take for granted all the duties, and complain about all the mistakes and disagreements, so I want to express here again my personal gratitude for your contribution. You did a lot for the multimedia community and for the free software community in general, and your personal contribution is impressive. I always found your attitude very helpful, even in spite of some sarcastic comments that you was used to make some years ago, and your honesty and frankness refreshing, and they contributed to make of FFmpeg the very successfull and cornerstone project it actually is, despite the many fights and flames it had to tackle. My wish is that now you'll be able now to spend more time for your own health and wellness. And of course I'd like you to be around the project, especially during this transitioning period. Losing your contribution and intimate knowledge of the code as well as of the theory and technology, as well as your personality, would be a tremendous loss. [...] If you now think ohh god what should i do, michael resigned very simple, FFmpeg is yours, that is everyones. try your best to make FFmpeg be the best. Post patches, review patches, apply patches, discuss code and design. Report bugs, bisect, debug and fix bugs, add features, help users. Do friendly merges, and if you like do hostile merges. Its all up to you now! I have no good
[FFmpeg-devel] [PATCH 1/4] x86inc: Support arbitrary stack alignments
Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not. --- libavcodec/x86/h264_deblock.asm | 4 +-- libavutil/x86/x86inc.asm| 62 ++--- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm index 14c8205..5151f3c 100644 --- a/libavcodec/x86/h264_deblock.asm +++ b/libavcodec/x86/h264_deblock.asm @@ -446,13 +446,13 @@ cglobal deblock_%1_luma_8, 5,5,8,2*%2 ;int8_t *tc0) ;- INIT_MMX cpuname -cglobal deblock_h_luma_8, 0,5,8,0x60+HAVE_ALIGNED_STACK*12 +cglobal deblock_h_luma_8, 0,5,8,0x60+12 movr0, r0mp movr3, r1m lear4, [r3*3] subr0, 4 lear1, [r0+r4] -%define pix_tmp esp+12*HAVE_ALIGNED_STACK +%define pix_tmp esp+12 ; transpose 6x16 - tmp space TRANSPOSE6x8_MEM PASS8ROWS(r0, r1, r3, r4), pix_tmp diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 12779f5..e176715 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -42,6 +42,17 @@ %define public_prefix private_prefix %endif +%if HAVE_ALIGNED_STACK +%define STACK_ALIGNMENT 16 +%endif +%ifndef STACK_ALIGNMENT +%if ARCH_X86_64 +%define STACK_ALIGNMENT 16 +%else +%define STACK_ALIGNMENT 4 +%endif +%endif + %define WIN64 0 %define UNIX64 0 %if ARCH_X86_64 @@ -108,8 +119,9 @@ ; %1 = number of arguments. loads them from stack if needed. ; %2 = number of registers used. pushes callee-saved regs if needed. ; %3 = number of xmm registers used. pushes callee-saved xmm regs if needed. -; %4 = (optional) stack size to be allocated. If not aligned (x86-32 ICC 10.x, -; MSVC or YMM), the stack will be manually aligned (to 16 or 32 bytes), +; %4 = (optional) stack size to be allocated. The stack will be aligned before +; allocating the specified stack size. If the required stack alignment is +; larger than the known stack alignment the stack will be manually aligned ; and an extra register will be allocated to hold the original stack ; pointer (to not invalidate r0m etc.). To prevent the use of an extra ; register as stack pointer, request a negative stack size. @@ -117,8 +129,10 @@ ; PROLOGUE can also be invoked by adding the same options to cglobal ; e.g. -; cglobal foo, 2,3,0, dst, src, tmp -; declares a function (foo), taking two args (dst and src) and one local variable (tmp) +; cglobal foo, 2,3,7,0x40, dst, src, tmp +; declares a function (foo) that automatically loads two arguments (dst and +; src) into registers, uses one additional register (tmp) plus 7 vector +; registers (m0-m6) and allocates 0x40 bytes of stack space. ; TODO Some functions can use some args directly from the stack. If they're the ; last args then you can just not declare them, but if they're in the middle @@ -319,26 +333,28 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 %assign n_arg_names %0 %endmacro +%define required_stack_alignment ((mmsize + 15) ~15) + %macro ALLOC_STACK 1-2 0 ; stack_size, n_xmm_regs (for win64 only) %ifnum %1 %if %1 != 0 -%assign %%stack_alignment ((mmsize + 15) ~15) +%assign %%pad 0 %assign stack_size %1 %if stack_size 0 %assign stack_size -stack_size %endif -%assign stack_size_padded stack_size %if WIN64 -%assign stack_size_padded stack_size_padded + 32 ; reserve 32 bytes for shadow space +%assign %%pad %%pad + 32 ; shadow space %if mmsize != 8 %assign xmm_regs_used %2 %if xmm_regs_used 8 -%assign stack_size_padded stack_size_padded + (xmm_regs_used-8)*16 +%assign %%pad %%pad + (xmm_regs_used-8)*16 ; callee-saved xmm registers %endif %endif %endif -%if mmsize = 16 HAVE_ALIGNED_STACK -%assign stack_size_padded stack_size_padded + %%stack_alignment - gprsize - (stack_offset (%%stack_alignment - 1)) +%if required_stack_alignment = STACK_ALIGNMENT +; maintain the current stack alignment +%assign stack_size_padded stack_size + %%pad + ((-%%pad-stack_offset-gprsize) (STACK_ALIGNMENT-1)) SUB rsp, stack_size_padded %else %assign %%reg_num (regs_used - 1) @@ -347,17 +363,17 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 ; it, i.e. in [rsp+stack_size_padded], so we can restore the ; stack in a single
[FFmpeg-devel] [PATCH 2/4] x86inc: Disable vpbroadcastq workaround in newer yasm versions
The bug was fixed in 1.3.0, so only perform the workaround in earlier versions. --- libavutil/x86/x86inc.asm | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index e176715..8581551 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -1481,13 +1481,15 @@ FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss -; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug -%if ARCH_X86_64 == 0 -%macro vpbroadcastq 2 -%if sizeof%1 == 16 -movddup %1, %2 -%else -vbroadcastsd %1, %2 -%endif -%endmacro +; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0) +%ifdef __YASM_VER__ +%if __YASM_VERSION_ID__ 0x0103 ARCH_X86_64 == 0 +%macro vpbroadcastq 2 +%if sizeof%1 == 16 +movddup %1, %2 +%else +vbroadcastsd %1, %2 +%endif +%endmacro +%endif %endif -- 1.8.3.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.
On Sun, 2 Aug 2015 23:45:36 +0200 Hendrik Leppkes h.lepp...@gmail.com wrote: On Sun, Aug 2, 2015 at 11:27 PM, Ivan Uskov ivan.us...@nablet.com wrote: Hello Michael, Sunday, August 2, 2015, 9:46:23 PM, you wrote: MN it appears the file was not in mfx_dispatch previously MN so a check in confgure might be needed As I can see here https://github.com/lu-zero/mfx_dispatch/tree/master/mfx The mfxjpeg.h was added 17 days ago and marked part of API 1.16. But really mfxjpeg.h was introduced by Intel at old-old API 1.3 (decoder) I do not use mfx_dispatch by myself at all, only native Intel Media SDK and patch compiles fine at my side. Looks like here some mess from mfx_dispatch side. Is there any similar case existing in ffpeg which I can use as template to implement own check in configure? MN its very simple, see any code using check_header and related functions MN in configure MN and HAVE_*_H defines MN [...] I have added simple check for mfxjpeg.h to configure, please review the attached update. The decoder should depend on the header in configure directly already, so its not built at all when the header is not available. Secondly, why is there a AVHWAccel in there? It doesn't have any callable functions, nor do we support AVHWAccel for mjpeg. For some reason the other QSV codecs also have this, but also without any functions in them - those serve no purpose and are likely to even cause problems if a user accidentally tries to use it. I'll send a patch to remove them, unless you can name a reason for them to exist. Because if it's missing, ff_get_format() refuses to return the QSV opaque format. I think. So you need AVHWAccels for every codec/decoder combination. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] x86inc: Disable vpbroadcastq workaround in newer yasm versions
Hi, On Sun, Aug 2, 2015 at 4:40 PM, Henrik Gramner hen...@gramner.com wrote: The bug was fixed in 1.3.0, so only perform the workaround in earlier versions. --- libavutil/x86/x86inc.asm | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index e176715..8581551 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -1481,13 +1481,15 @@ FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss -; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug -%if ARCH_X86_64 == 0 -%macro vpbroadcastq 2 -%if sizeof%1 == 16 -movddup %1, %2 -%else -vbroadcastsd %1, %2 -%endif -%endmacro +; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0) +%ifdef __YASM_VER__ +%if __YASM_VERSION_ID__ 0x0103 ARCH_X86_64 == 0 +%macro vpbroadcastq 2 +%if sizeof%1 == 16 +movddup %1, %2 +%else +vbroadcastsd %1, %2 +%endif +%endmacro +%endif %endif OK. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] x86inc: Support arbitrary stack alignments
On 02/08/15 5:40 PM, Henrik Gramner wrote: Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not. --- libavcodec/x86/h264_deblock.asm | 4 +-- libavutil/x86/x86inc.asm| 62 ++--- Someone with msvc should test if this doesn't break 8ch audio conversion when using libswresample (libswresample/x86/audio_convert.asm), where HAVE_ALIGNED_STACK is also (ab)used. FATE will not because afaik there are no tests that deal with 8ch audio files at all. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/4] x86inc: Various minor backports from x264
On Sun, Aug 02, 2015 at 07:45:57PM -0400, Ronald S. Bultje wrote: Hi, On Sun, Aug 2, 2015 at 4:40 PM, Henrik Gramner hen...@gramner.com wrote: --- libavutil/x86/x86inc.asm | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) lgtm. applied Henrik, if you want git write access send me your public ssh key ronald if you want me to put some other key there for you or anything, just say so thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 5/5] crypto_bench: add support for ripemd-128
Signed-off-by: James Almer jamr...@gmail.com --- tools/crypto_bench.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index 5af2dc1..5ae4715 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -106,6 +106,7 @@ static void run_lavu_ ## suffix(uint8_t *output, \ DEFINE_LAVU_MD(sha1, AVSHA,sha, 160); DEFINE_LAVU_MD(sha256,AVSHA,sha, 256); DEFINE_LAVU_MD(sha512,AVSHA512, sha512, 512); +DEFINE_LAVU_MD(ripemd128, AVRIPEMD, ripemd, 128); DEFINE_LAVU_MD(ripemd160, AVRIPEMD, ripemd, 160); static void run_lavu_aes128(uint8_t *output, @@ -400,6 +401,7 @@ DEFINE_TOMCRYPT_WRAPPER(md5, md5,MD5) DEFINE_TOMCRYPT_WRAPPER(sha1, sha1, SHA1) DEFINE_TOMCRYPT_WRAPPER(sha256,sha256, SHA256) DEFINE_TOMCRYPT_WRAPPER(sha512,sha512, SHA512) +DEFINE_TOMCRYPT_WRAPPER(ripemd128, rmd128, RIPEMD128) DEFINE_TOMCRYPT_WRAPPER(ripemd160, rmd160, RIPEMD160) static void run_tomcrypt_aes128(uint8_t *output, @@ -565,6 +567,8 @@ struct hash_impl implementations[] = { IMPL_ALL(SHA-256,sha256, 14028ac673b3087e51a1d407fbf0df4deeec8f217119e13b07bf2138f93db8c5) IMPL_ALL(SHA-512,sha512, 3afdd44a80d99af15c87bd724cb717243193767835ce866dd5d58c02d674bb57 7c25b9e118c200a189fcd5a01ef106a4e200061f3e97dbf50ba065745fd46bef) +IMPL(lavu, RIPEMD-128, ripemd128, 9ab8bfba2ddccc5d99c9d4cdfb844a5f) +IMPL(tomcrypt, RIPEMD-128, ripemd128, 9ab8bfba2ddccc5d99c9d4cdfb844a5f) IMPL_ALL(RIPEMD-160, ripemd160, 62a5321e4fc8784903bb43ab7752c75f8b25af00) IMPL_ALL(AES-128,aes128,crc:ff6bc888) IMPL_ALL(CAMELLIA, camellia, crc:7abb59a7) -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/5] crypto_bench: add support for des
OpenSSL and Tomcrypt des modules are not benched together as there's some naming collisions between the two. Signed-off-by: James Almer jamr...@gmail.com --- tools/crypto_bench.c | 58 1 file changed, 58 insertions(+) diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index fb749ac..5af2dc1 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -76,6 +76,7 @@ struct hash_impl { #include libavutil/ripemd.h #include libavutil/aes.h #include libavutil/blowfish.h +#include libavutil/des.h #include libavutil/camellia.h #include libavutil/cast5.h #include libavutil/twofish.h @@ -147,6 +148,16 @@ static void run_lavu_cast128(uint8_t *output, av_cast5_crypt(cast, output, input, size 3, 0); } +static void run_lavu_des(uint8_t *output, + const uint8_t *input, unsigned size) +{ +static struct AVDES *des; +if (!des !(des = av_des_alloc())) +fatal_error(out of memory); +av_des_init(des, hardcoded_key, 64, 0); +av_des_crypt(des, output, input, size 3, NULL, 0); +} + static void run_lavu_twofish(uint8_t *output, const uint8_t *input, unsigned size) { @@ -190,6 +201,9 @@ static void run_lavu_xtea(uint8_t *output, #include openssl/blowfish.h #include openssl/camellia.h #include openssl/cast.h +#if !((USE_EXT_LIBS) USE_tomcrypt) +#include openssl/des.h +#endif #include openssl/rc4.h #define DEFINE_CRYPTO_WRAPPER(suffix, function) \ @@ -240,6 +254,19 @@ static void run_crypto_camellia(uint8_t *output, Camellia_ecb_encrypt(input + i, output + i, camellia, 1); } +#if !((USE_EXT_LIBS) USE_tomcrypt) +static void run_crypto_des(uint8_t *output, +const uint8_t *input, unsigned size) +{ +DES_key_schedule des; +unsigned i; + +DES_set_key(hardcoded_key, des); +for (i = 0; i size; i += 8) +DES_ecb_encrypt(input + i, output + i, des, 1); +} +#endif + static void run_crypto_cast128(uint8_t *output, const uint8_t *input, unsigned size) { @@ -326,6 +353,16 @@ static void run_gcrypt_cast128(uint8_t *output, gcry_cipher_encrypt(cast, output, size, input, size); } +static void run_gcrypt_des(uint8_t *output, +const uint8_t *input, unsigned size) +{ +static gcry_cipher_hd_t des; +if (!des) +gcry_cipher_open(des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); +gcry_cipher_setkey(des, hardcoded_key, 8); +gcry_cipher_encrypt(des, output, size, input, size); +} + static void run_gcrypt_twofish(uint8_t *output, const uint8_t *input, unsigned size) { @@ -400,6 +437,19 @@ static void run_tomcrypt_camellia(uint8_t *output, camellia_ecb_encrypt(input + i, output + i, camellia); } +#if !((USE_EXT_LIBS) USE_crypto) +static void run_tomcrypt_des(uint8_t *output, + const uint8_t *input, unsigned size) +{ +symmetric_key des; +unsigned i; + +des_setup(hardcoded_key, 8, 0, des); +for (i = 0; i size; i += 8) +des_ecb_encrypt(input + i, output + i, des); +} +#endif + static void run_tomcrypt_cast128(uint8_t *output, const uint8_t *input, unsigned size) { @@ -519,6 +569,14 @@ struct hash_impl implementations[] = { IMPL_ALL(AES-128,aes128,crc:ff6bc888) IMPL_ALL(CAMELLIA, camellia, crc:7abb59a7) IMPL_ALL(CAST-128, cast128, crc:456aa584) +IMPL(lavu, DES, des, crc:31291e0b) +IMPL(gcrypt, DES, des, crc:31291e0b) +#if !((USE_EXT_LIBS) USE_tomcrypt) +IMPL(crypto, DES, des, crc:31291e0b) +#endif +#if !((USE_EXT_LIBS) USE_crypto) +IMPL(tomcrypt, DES, des, crc:31291e0b) +#endif IMPL_ALL(BLOWFISH, blowfish, crc:33e8aa74) IMPL(lavu, TWOFISH, twofish, crc:9edbd5c1) IMPL(gcrypt, TWOFISH, twofish, crc:9edbd5c1) -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] x86inc: Support arbitrary stack alignments
Hi, On Sun, Aug 2, 2015 at 4:40 PM, Henrik Gramner hen...@gramner.com wrote: Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not. --- libavcodec/x86/h264_deblock.asm | 4 +-- libavutil/x86/x86inc.asm| 62 ++--- 2 files changed, 42 insertions(+), 24 deletions(-) So, I think the code changes themselves look mostly healthy. Is there a behavioural difference before/after this patch? (Like: were there bugs in the original code, or does this change behaviour of previous code in a significant way?) Thanks, Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] x86inc: Disable vpbroadcastq workaround in newer yasm versions
On Sun, Aug 02, 2015 at 07:36:51PM -0400, Ronald S. Bultje wrote: Hi, On Sun, Aug 2, 2015 at 4:40 PM, Henrik Gramner hen...@gramner.com wrote: The bug was fixed in 1.3.0, so only perform the workaround in earlier versions. --- libavutil/x86/x86inc.asm | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index e176715..8581551 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -1481,13 +1481,15 @@ FMA4_INSTR fnmsubps, fnmsub132ps, fnmsub213ps, fnmsub231ps FMA4_INSTR fnmsubsd, fnmsub132sd, fnmsub213sd, fnmsub231sd FMA4_INSTR fnmsubss, fnmsub132ss, fnmsub213ss, fnmsub231ss -; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug -%if ARCH_X86_64 == 0 -%macro vpbroadcastq 2 -%if sizeof%1 == 16 -movddup %1, %2 -%else -vbroadcastsd %1, %2 -%endif -%endmacro +; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0) +%ifdef __YASM_VER__ +%if __YASM_VERSION_ID__ 0x0103 ARCH_X86_64 == 0 +%macro vpbroadcastq 2 +%if sizeof%1 == 16 +movddup %1, %2 +%else +vbroadcastsd %1, %2 +%endif +%endmacro +%endif %endif OK. applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/5] crypto_bench: add support for blowfish
Signed-off-by: James Almer jamr...@gmail.com --- tools/crypto_bench.c | 45 + 1 file changed, 45 insertions(+) diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index 79629bc..d1e7c30 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -75,6 +75,7 @@ struct hash_impl { #include libavutil/sha512.h #include libavutil/ripemd.h #include libavutil/aes.h +#include libavutil/blowfish.h #include libavutil/camellia.h #include libavutil/cast5.h #include libavutil/twofish.h @@ -114,6 +115,16 @@ static void run_lavu_aes128(uint8_t *output, av_aes_crypt(aes, output, input, size 4, NULL, 0); } +static void run_lavu_blowfish(uint8_t *output, + const uint8_t *input, unsigned size) +{ +static struct AVBlowfish *blowfish; +if (!blowfish !(blowfish = av_blowfish_alloc())) +fatal_error(out of memory); +av_blowfish_init(blowfish, hardcoded_key, 16); +av_blowfish_crypt(blowfish, output, input, size 3, NULL, 0); +} + static void run_lavu_camellia(uint8_t *output, const uint8_t *input, unsigned size) { @@ -153,6 +164,7 @@ static void run_lavu_twofish(uint8_t *output, #include openssl/sha.h #include openssl/ripemd.h #include openssl/aes.h +#include openssl/blowfish.h #include openssl/camellia.h #include openssl/cast.h @@ -181,6 +193,17 @@ static void run_crypto_aes128(uint8_t *output, AES_encrypt(input + i, output + i, aes); } +static void run_crypto_blowfish(uint8_t *output, +const uint8_t *input, unsigned size) +{ +BF_KEY blowfish; +unsigned i; + +BF_set_key(blowfish, 16, hardcoded_key); +for (i = 0; i size; i += 8) +BF_ecb_encrypt(input + i, output + i, blowfish, 1); +} + static void run_crypto_camellia(uint8_t *output, const uint8_t *input, unsigned size) { @@ -240,6 +263,16 @@ static void run_gcrypt_aes128(uint8_t *output, gcry_cipher_encrypt(aes, output, size, input, size); } +static void run_gcrypt_blowfish(uint8_t *output, +const uint8_t *input, unsigned size) +{ +static gcry_cipher_hd_t blowfish; +if (!blowfish) +gcry_cipher_open(blowfish, GCRY_CIPHER_BLOWFISH, GCRY_CIPHER_MODE_ECB, 0); +gcry_cipher_setkey(blowfish, hardcoded_key, 16); +gcry_cipher_encrypt(blowfish, output, size, input, size); +} + static void run_gcrypt_camellia(uint8_t *output, const uint8_t *input, unsigned size) { @@ -311,6 +344,17 @@ static void run_tomcrypt_aes128(uint8_t *output, aes_ecb_encrypt(input + i, output + i, aes); } +static void run_tomcrypt_blowfish(uint8_t *output, + const uint8_t *input, unsigned size) +{ +symmetric_key blowfish; +unsigned i; + +blowfish_setup(hardcoded_key, 16, 0, blowfish); +for (i = 0; i size; i += 8) +blowfish_ecb_encrypt(input + i, output + i, blowfish); +} + static void run_tomcrypt_camellia(uint8_t *output, const uint8_t *input, unsigned size) { @@ -431,6 +475,7 @@ struct hash_impl implementations[] = { IMPL_ALL(AES-128,aes128,crc:ff6bc888) IMPL_ALL(CAMELLIA, camellia, crc:7abb59a7) IMPL_ALL(CAST-128, cast128, crc:456aa584) +IMPL_ALL(BLOWFISH, blowfish, crc:33e8aa74) IMPL(lavu, TWOFISH, twofish, crc:9edbd5c1) IMPL(gcrypt, TWOFISH, twofish, crc:9edbd5c1) IMPL(tomcrypt, TWOFISH, twofish, crc:9edbd5c1) -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/5] crypto_bench: add support for xtea
Signed-off-by: James Almer jamr...@gmail.com --- tools/crypto_bench.c | 24 1 file changed, 24 insertions(+) diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index 87e99d0..fb749ac 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -80,6 +80,7 @@ struct hash_impl { #include libavutil/cast5.h #include libavutil/twofish.h #include libavutil/rc4.h +#include libavutil/xtea.h #define IMPL_USE_lavu IMPL_USE @@ -166,6 +167,16 @@ static void run_lavu_rc4(uint8_t *output, av_rc4_crypt(rc4, output, input, size, NULL, 0); } +static void run_lavu_xtea(uint8_t *output, + const uint8_t *input, unsigned size) +{ +static struct AVXTEA *xtea; +if (!xtea !(xtea = av_xtea_alloc())) +fatal_error(out of memory); +av_xtea_init(xtea, hardcoded_key); +av_xtea_crypt(xtea, output, input, size 3, NULL, 0); +} + /*** * crypto: OpenSSL's libcrypto ***/ @@ -412,6 +423,17 @@ static void run_tomcrypt_twofish(uint8_t *output, twofish_ecb_encrypt(input + i, output + i, twofish); } +static void run_tomcrypt_xtea(uint8_t *output, + const uint8_t *input, unsigned size) +{ +symmetric_key xtea; +unsigned i; + +xtea_setup(hardcoded_key, 16, 0, xtea); +for (i = 0; i size; i += 8) +xtea_ecb_encrypt(input + i, output + i, xtea); +} + #define IMPL_USE_tomcrypt(...) IMPL_USE(__VA_ARGS__) #else @@ -503,6 +525,8 @@ struct hash_impl implementations[] = { IMPL(tomcrypt, TWOFISH, twofish, crc:9edbd5c1) IMPL(lavu, RC4, rc4, crc:538d37b2) IMPL(crypto, RC4, rc4, crc:538d37b2) +IMPL(lavu, XTEA,xtea,crc:931fc270) +IMPL(tomcrypt, XTEA,xtea,crc:931fc270) }; int main(int argc, char **argv) -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/5] crypto_bench: add support for rc4
Signed-off-by: James Almer jamr...@gmail.com --- tools/crypto_bench.c | 24 1 file changed, 24 insertions(+) diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c index d1e7c30..87e99d0 100644 --- a/tools/crypto_bench.c +++ b/tools/crypto_bench.c @@ -79,6 +79,7 @@ struct hash_impl { #include libavutil/camellia.h #include libavutil/cast5.h #include libavutil/twofish.h +#include libavutil/rc4.h #define IMPL_USE_lavu IMPL_USE @@ -154,6 +155,17 @@ static void run_lavu_twofish(uint8_t *output, av_twofish_init(twofish, hardcoded_key, 128); av_twofish_crypt(twofish, output, input, size 4, NULL, 0); } + +static void run_lavu_rc4(uint8_t *output, + const uint8_t *input, unsigned size) +{ +static struct AVRC4 *rc4; +if (!rc4 !(rc4 = av_rc4_alloc())) +fatal_error(out of memory); +av_rc4_init(rc4, hardcoded_key, 128, 0); +av_rc4_crypt(rc4, output, input, size, NULL, 0); +} + /*** * crypto: OpenSSL's libcrypto ***/ @@ -167,6 +179,7 @@ static void run_lavu_twofish(uint8_t *output, #include openssl/blowfish.h #include openssl/camellia.h #include openssl/cast.h +#include openssl/rc4.h #define DEFINE_CRYPTO_WRAPPER(suffix, function) \ static void run_crypto_ ## suffix(uint8_t *output, \ @@ -227,6 +240,15 @@ static void run_crypto_cast128(uint8_t *output, CAST_ecb_encrypt(input + i, output + i, cast, 1); } +static void run_crypto_rc4(uint8_t *output, +const uint8_t *input, unsigned size) +{ +RC4_KEY rc4; + +RC4_set_key(rc4, 16, hardcoded_key); +RC4(rc4, size, input, output); +} + #define IMPL_USE_crypto(...) IMPL_USE(__VA_ARGS__) #else #define IMPL_USE_crypto(...) /* ignore */ @@ -479,6 +501,8 @@ struct hash_impl implementations[] = { IMPL(lavu, TWOFISH, twofish, crc:9edbd5c1) IMPL(gcrypt, TWOFISH, twofish, crc:9edbd5c1) IMPL(tomcrypt, TWOFISH, twofish, crc:9edbd5c1) +IMPL(lavu, RC4, rc4, crc:538d37b2) +IMPL(crypto, RC4, rc4, crc:538d37b2) }; int main(int argc, char **argv) -- 2.5.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/4] x86inc: Various minor backports from x264
Hi, On Sun, Aug 2, 2015 at 4:40 PM, Henrik Gramner hen...@gramner.com wrote: --- libavutil/x86/x86inc.asm | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) lgtm. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] x86inc: Support arbitrary stack alignments
Hi, On Sun, Aug 2, 2015 at 7:56 PM, James Almer jamr...@gmail.com wrote: On 02/08/15 5:40 PM, Henrik Gramner wrote: Change ALLOC_STACK to always align the stack before allocating stack space for consistency. Previously alignment would occur either before or after allocating stack space depending on whether manual alignment was required or not. --- libavcodec/x86/h264_deblock.asm | 4 +-- libavutil/x86/x86inc.asm| 62 ++--- Someone with msvc should test if this doesn't break 8ch audio conversion when using libswresample (libswresample/x86/audio_convert.asm), where HAVE_ALIGNED_STACK is also (ab)used. FATE will not because afaik there are no tests that deal with 8ch audio files at all. Importantly, on 32bit only. Fortunately, I believe swscale also uses this construct in a few places, as does vp8/9, so a default fate run definitely is useful. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel