[FFmpeg-cvslog] avfilter/showcqt: fix compilation with libswscale disabled

2015-10-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Oct 29 02:11:58 
2015 -0300| [fc460fe618478982829950f9a806ba29c6607517] | committer: James Almer

avfilter/showcqt: fix compilation with libswscale disabled

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc460fe618478982829950f9a806ba29c6607517
---

 configure|2 +-
 libavfilter/Makefile |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0cb04f0..3f0ef0d 100755
--- a/configure
+++ b/configure
@@ -2832,7 +2832,7 @@ scale_filter_deps="swscale"
 scale2ref_filter_deps="swscale"
 select_filter_select="pixelutils"
 smartblur_filter_deps="gpl swscale"
-showcqt_filter_deps="avcodec"
+showcqt_filter_deps="avcodec swscale"
 showcqt_filter_select="fft"
 showfreqs_filter_deps="avcodec"
 showfreqs_filter_select="fft"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index d229af4..c5819d4 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -272,7 +272,7 @@ OBJS-$(CONFIG_ADRAWGRAPH_FILTER) += 
f_drawgraph.o
 OBJS-$(CONFIG_APHASEMETER_FILTER)+= avf_aphasemeter.o
 OBJS-$(CONFIG_AVECTORSCOPE_FILTER)   += avf_avectorscope.o
 OBJS-$(CONFIG_CONCAT_FILTER) += avf_concat.o
-OBJS-$(CONFIG_SHOWCQT_FILTER)+= avf_showcqt.o
+OBJS-$(CONFIG_SHOWCQT_FILTER)+= avf_showcqt.o lswsutils.o
 OBJS-$(CONFIG_SHOWFREQS_FILTER)  += avf_showfreqs.o
 OBJS-$(CONFIG_SHOWSPECTRUM_FILTER)   += avf_showspectrum.o
 OBJS-$(CONFIG_SHOWVOLUME_FILTER) += avf_showvolume.o

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


[FFmpeg-cvslog] avutil/audio_fifo: add av_warn_unused_result

2015-10-28 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Thu Oct 
15 19:24:14 2015 -0400| [dd367495578d406ab6456fca7e2a0c4a5bc50b0a] | committer: 
Ganesh Ajjanagadde

avutil/audio_fifo: add av_warn_unused_result

This one should not trigger any warnings, but will be useful for future
robustness.

Strictly speaking, one could check the size after the call by examining
the structure instead of the return value. Such a use case is highly
unusual, and this commit may be easily reverted if there is a legitimate
need of such use.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd367495578d406ab6456fca7e2a0c4a5bc50b0a
---

 libavutil/audio_fifo.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/audio_fifo.h b/libavutil/audio_fifo.h
index d93be2a..24f91da 100644
--- a/libavutil/audio_fifo.h
+++ b/libavutil/audio_fifo.h
@@ -73,6 +73,7 @@ AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat 
sample_fmt, int channels,
  * @param nb_samples  new allocation size, in samples
  * @return0 if OK, or negative AVERROR code on failure
  */
+av_warn_unused_result
 int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
 
 /**

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


[FFmpeg-cvslog] vp9_parser: don't overwrite cached timestamps with nopts.

2015-10-28 Thread Ronald S. Bultje
ffmpeg | branch: master | Ronald S. Bultje  | Wed Oct 28 
12:20:25 2015 -0400| [63fca9df9c6f236c16a5ac0b60e73cb0e7669b2e] | committer: 
Ronald S. Bultje

vp9_parser: don't overwrite cached timestamps with nopts.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63fca9df9c6f236c16a5ac0b60e73cb0e7669b2e
---

 libavcodec/vp9_parser.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c
index 0437097..6713850 100644
--- a/libavcodec/vp9_parser.c
+++ b/libavcodec/vp9_parser.c
@@ -64,7 +64,7 @@ static int parse_frame(AVCodecParserContext *ctx, const 
uint8_t *buf, int size)
 if (ctx->pts == AV_NOPTS_VALUE)
 ctx->pts = s->pts;
 s->pts = AV_NOPTS_VALUE;
-} else {
+} else if (ctx->pts != AV_NOPTS_VALUE) {
 s->pts = ctx->pts;
 ctx->pts = AV_NOPTS_VALUE;
 }

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


[FFmpeg-cvslog] avcodec/motion_est_template: replace qsort with AV_QSORT

2015-10-28 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Tue Oct 
27 22:46:18 2015 -0400| [6dc0db6634f45cd1a9af5765c7a16ddf9cb0b341] | committer: 
Ganesh Ajjanagadde

avcodec/motion_est_template: replace qsort with AV_QSORT

This code is in a performance critical section. AV_QSORT is
substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance is worth the increase in binary size.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6dc0db6634f45cd1a9af5765c7a16ddf9cb0b341
---

 libavcodec/motion_est_template.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index 37ff110..327a24b 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -24,6 +24,7 @@
  * Motion estimation template.
  */
 
+#include "libavutil/qsort.h"
 #include "mpegvideo.h"
 
 //Let us hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
@@ -723,7 +724,7 @@ static int sab_diamond_search(MpegEncContext * s, int 
*best, int dmin,
 j++;
 }
 
-qsort(minima, j, sizeof(Minima), minima_cmp);
+AV_QSORT(minima, j, Minima, minima_cmp);
 
 for(; jhttp://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avutil/ripemd: make rol macro more robust by adding parentheses

2015-10-28 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Tue Oct 
27 19:58:41 2015 -0400| [fab1562a50684783f5567c5262c942f5cda9656f] | committer: 
Ganesh Ajjanagadde

avutil/ripemd: make rol macro more robust by adding parentheses

This ensures that the macro remains correct in the sense of allowing
expressions for value and bits, by placing the value and bits expressions within
parentheses.

Reviewed-by: James Almer 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fab1562a50684783f5567c5262c942f5cda9656f
---

 libavutil/ripemd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/ripemd.c b/libavutil/ripemd.c
index d247fb4..6777c99 100644
--- a/libavutil/ripemd.c
+++ b/libavutil/ripemd.c
@@ -85,7 +85,7 @@ static const int WB[80] = {
 12, 15, 10,  4,  1,  5,  8,  7,  6,  2, 13, 14,  0,  3,  9, 11
 };
 
-#define rol(value, bits) ((value << bits) | (value >> (32 - bits)))
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits
 
 #define ROUND128_0_TO_15(a,b,c,d,e,f,g,h)   \
 a = rol(a + ((  b ^ c  ^ d)  + block[WA[n]]), ROTA[n]); \

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


[FFmpeg-cvslog] doc/encoders: fix "the their" typo

2015-10-28 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Wed Oct 28 13:23:52 2015 
-0800| [2193f537ed355e38935bc407ab38bf13b267a34d] | committer: Lou Logan

doc/encoders: fix "the their" typo

Signed-off-by: Lou Logan 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2193f537ed355e38935bc407ab38bf13b267a34d
---

 doc/encoders.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index ba7f2b7..659f5d7 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1125,7 +1125,7 @@ kilobits/s.
 
 @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
 Set VBR mode. The FFmpeg @option{vbr} option has the following
-valid arguments, with the their @command{opusenc} equivalent options
+valid arguments, with the @command{opusenc} equivalent options
 in parentheses:
 
 @table @samp

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


[FFmpeg-cvslog] doc/filters: Remove article redundancy

2015-10-28 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Oct 28 14:20:09 2015 +0100| [3f5029181307d9e3e1558234b4bd9985269f62b4] | 
committer: Michael Niedermayer

doc/filters: Remove article redundancy

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f5029181307d9e3e1558234b4bd9985269f62b4
---

 doc/filters.texi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a42dc6f..15ea77a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -13756,7 +13756,7 @@ Specify the transform count for every video frame. 
Default value is @code{6}.
 Acceptable range is @code{[1, 30]}.
 
 @item fcount
-Specify the the transform count for every single pixel. Default value is 
@code{0},
+Specify the transform count for every single pixel. Default value is @code{0},
 which makes it computed automatically. Acceptable range is @code{[0, 10]}.
 
 @item fontfile

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


[FFmpeg-cvslog] swr: do not reject channel layouts that use channel 63

2015-10-28 Thread wm4
ffmpeg | branch: master | wm4  | Wed Oct 28 19:25:49 
2015 +0100| [80580bb24014115e951b33135c330ed13c4f3b9c] | committer: wm4

swr: do not reject channel layouts that use channel 63

Channel layouts are essentially uint64_t, and every value is valid.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80580bb24014115e951b33135c330ed13c4f3b9c
---

 libswresample/options.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswresample/options.c b/libswresample/options.c
index 0bcb102..2bf8ab1 100644
--- a/libswresample/options.c
+++ b/libswresample/options.c
@@ -51,10 +51,10 @@ static const AVOption options[]={
 {"out_sample_fmt"   , "set output sample format", 
OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
 {"tsf"  , "set internal sample format"  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
 {"internal_sample_fmt"  , "set internal sample format"  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
-{"icl"  , "set input channel layout", 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
-{"in_channel_layout", "set input channel layout", 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
-{"ocl"  , "set output channel layout"   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
-{"out_channel_layout"   , "set output channel layout"   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
+{"icl"  , "set input channel layout", 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 
INT64_MIN, INT64_MAX , PARAM, "channel_layout"},
+{"in_channel_layout", "set input channel layout", 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 
INT64_MIN, INT64_MAX , PARAM, "channel_layout"},
+{"ocl"  , "set output channel layout"   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 
INT64_MIN, INT64_MAX , PARAM, "channel_layout"},
+{"out_channel_layout"   , "set output channel layout"   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0   }, 
INT64_MIN, INT64_MAX , PARAM, "channel_layout"},
 {"clev" , "set center mix level", OFFSET(clev  
 ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB}, -32, 32, 
PARAM},
 {"center_mix_level" , "set center mix level", OFFSET(clev  
 ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB}, -32, 32, 
PARAM},
 {"slev" , "set surround mix level"  , OFFSET(slev  
 ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB}, -32, 32, 
PARAM},

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


[FFmpeg-cvslog] lavu/aes: test CBC functionality

2015-10-28 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Sun Oct 11 
22:15:52 2015 -0500| [cceed8389d6122fba8e59b267081d16fdbadb25e] | committer: 
Rodger Combs

lavu/aes: test CBC functionality

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cceed8389d6122fba8e59b267081d16fdbadb25e
---

 libavutil/aes.c |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/libavutil/aes.c b/libavutil/aes.c
index dde15be..9096f03 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -280,7 +280,7 @@ int main(int argc, char **argv)
 { 0x10, 0xa5, 0x88, 0x69, 0xd7, 0x4b, 0xe5, 0xa3,
   0x74, 0xcf, 0x86, 0x7c, 0xfb, 0x47, 0x38, 0x59 }
 };
-uint8_t pt[16], rpt[2][16]= {
+uint8_t pt[32], rpt[2][16]= {
 { 0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad,
   0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3 },
 { 0 }
@@ -291,7 +291,8 @@ int main(int argc, char **argv)
 { 0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0,
   0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65 }
 };
-uint8_t temp[16];
+uint8_t temp[32];
+uint8_t iv[2][16];
 int err = 0;
 
 av_log_set_level(AV_LOG_DEBUG);
@@ -317,16 +318,24 @@ int main(int argc, char **argv)
 av_lfg_init(&prng, 1);
 
 for (i = 0; i < 1; i++) {
-for (j = 0; j < 16; j++) {
+for (j = 0; j < 32; j++) {
 pt[j] = av_lfg_get(&prng);
 }
+for (j = 0; j < 16; j++) {
+iv[0][j] = iv[1][j] = av_lfg_get(&prng);
+}
 {
 START_TIMER;
-av_aes_crypt(&ae, temp, pt, 1, NULL, 0);
+av_aes_crypt(&ae, temp, pt, 2, iv[0], 0);
+if (!(i & (i - 1)))
+av_log(NULL, AV_LOG_ERROR, "%02X %02X %02X %02X\n",
+   temp[0], temp[5], temp[10], temp[15]);
+av_aes_crypt(&ad, temp, temp, 2, iv[1], 1);
+av_aes_crypt(&ae, temp, pt, 2, NULL, 0);
 if (!(i & (i - 1)))
 av_log(NULL, AV_LOG_ERROR, "%02X %02X %02X %02X\n",
temp[0], temp[5], temp[10], temp[15]);
-av_aes_crypt(&ad, temp, temp, 1, NULL, 1);
+av_aes_crypt(&ad, temp, temp, 2, NULL, 1);
 STOP_TIMER("aes");
 }
 for (j = 0; j < 16; j++) {

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


[FFmpeg-cvslog] avcodec/png: read and write stereo3d frame side data information

2015-10-28 Thread Kirill Gavrilov
ffmpeg | branch: master | Kirill Gavrilov  | Thu Oct 22 
23:36:52 2015 +0300| [bea931c2eb776603074c463e127cb348d195bde7] | committer: 
Michael Niedermayer

avcodec/png: read and write stereo3d frame side data information

Use optional sTER chunk defining side-by-side stereo pair
within "Extensions to the PNG 1.2 Specification", version 1.3.0.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bea931c2eb776603074c463e127cb348d195bde7
---

 libavcodec/pngdec.c |   16 
 libavcodec/pngenc.c |   19 +++
 2 files changed, 35 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 4cfdc58..99111d4 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -24,6 +24,7 @@
 #include "libavutil/avassert.h"
 #include "libavutil/bprint.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/stereo3d.h"
 #include "avcodec.h"
 #include "bytestream.h"
 #include "internal.h"
@@ -1164,6 +1165,21 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 av_log(avctx, AV_LOG_WARNING, "Broken zTXt chunk\n");
 bytestream2_skip(&s->gb, length + 4);
 break;
+case MKTAG('s', 'T', 'E', 'R'): {
+AVStereo3D *stereo3d = av_stereo3d_create_side_data(p);
+if (!stereo3d) {
+goto fail;
+} else if (*s->gb.buffer == 0) {
+stereo3d->type  = AV_STEREO3D_SIDEBYSIDE;
+stereo3d->flags = AV_STEREO3D_FLAG_INVERT;
+} else if (*s->gb.buffer == 1) {
+stereo3d->type  = AV_STEREO3D_SIDEBYSIDE;
+} else {
+ av_log(avctx, AV_LOG_WARNING, "Broken sTER chunk - unknown 
value\n");
+}
+bytestream2_skip(&s->gb, length + 4);
+break;
+}
 case MKTAG('I', 'E', 'N', 'D'):
 if (!(s->state & PNG_ALLIMAGE))
 av_log(avctx, AV_LOG_ERROR, "IEND without all image\n");
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 4204df2..bc61f8f 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -31,6 +31,7 @@
 #include "libavutil/libm.h"
 #include "libavutil/opt.h"
 #include "libavutil/color_utils.h"
+#include "libavutil/stereo3d.h"
 
 #include 
 
@@ -340,6 +341,7 @@ static int png_get_gama(enum AVColorTransferCharacteristic 
trc, uint8_t *buf)
 
 static int encode_headers(AVCodecContext *avctx, const AVFrame *pict)
 {
+AVFrameSideData *side_data;
 PNGEncContext *s = avctx->priv_data;
 
 /* write png header */
@@ -364,6 +366,23 @@ static int encode_headers(AVCodecContext *avctx, const 
AVFrame *pict)
 }
 png_write_chunk(&s->bytestream, MKTAG('p', 'H', 'Y', 's'), s->buf, 9);
 
+/* write stereoscopic information */
+side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_STEREO3D);
+if (side_data) {
+AVStereo3D *stereo3d = (AVStereo3D *)side_data->data;
+switch (stereo3d->type) {
+case AV_STEREO3D_SIDEBYSIDE:
+s->buf[0] = ((stereo3d->flags & AV_STEREO3D_FLAG_INVERT) == 0) 
? 1 : 0;
+png_write_chunk(&s->bytestream, MKTAG('s', 'T', 'E', 'R'), 
s->buf, 1);
+break;
+case AV_STEREO3D_2D:
+break;
+default:
+av_log(avctx, AV_LOG_WARNING, "Only side-by-side stereo3d flag 
can be defined within sTER chunk\n");
+break;
+}
+}
+
 /* write colorspace information */
 if (pict->color_primaries == AVCOL_PRI_BT709 &&
 pict->color_trc == AVCOL_TRC_IEC61966_2_1) {

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


[FFmpeg-cvslog] lavu: add AESNI CPU flag

2015-10-28 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Mon Oct 26 
02:08:58 2015 -0500| [1e477a970fd57f83b210b3cbc77698891d6bdf78] | committer: 
Rodger Combs

lavu: add AESNI CPU flag

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e477a970fd57f83b210b3cbc77698891d6bdf78
---

 configure |4 
 doc/APIchanges|3 +++
 libavutil/cpu.c   |4 
 libavutil/cpu.h   |1 +
 libavutil/version.h   |2 +-
 libavutil/x86/cpu.c   |2 ++
 libavutil/x86/cpu.h   |3 +++
 libavutil/x86/x86inc.asm  |   13 +++--
 tests/checkasm/checkasm.c |1 +
 9 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index 42f6e2c..0cb04f0 100755
--- a/configure
+++ b/configure
@@ -368,6 +368,7 @@ Optimization options (experts only):
   --disable-fma3   disable FMA3 optimizations
   --disable-fma4   disable FMA4 optimizations
   --disable-avx2   disable AVX2 optimizations
+  --disable-aesni  disable AESNI optimizations
   --disable-armv5tedisable armv5te optimizations
   --disable-armv6  disable armv6 optimizations
   --disable-armv6t2disable armv6t2 optimizations
@@ -1635,6 +1636,7 @@ ARCH_EXT_LIST_LOONGSON="
 "
 
 ARCH_EXT_LIST_X86_SIMD="
+aesni
 amd3dnow
 amd3dnowext
 avx
@@ -2128,6 +2130,7 @@ sse3_deps="sse2"
 ssse3_deps="sse3"
 sse4_deps="ssse3"
 sse42_deps="sse4"
+aesni_deps="sse42"
 avx_deps="sse42"
 xop_deps="avx"
 fma3_deps="avx"
@@ -6011,6 +6014,7 @@ if enabled x86; then
 echo "3DNow! extended enabled   ${amd3dnowext-no}"
 echo "SSE enabled   ${sse-no}"
 echo "SSSE3 enabled ${ssse3-no}"
+echo "AESNI enabled ${aesni-no}"
 echo "AVX enabled   ${avx-no}"
 echo "XOP enabled   ${xop-no}"
 echo "FMA3 enabled  ${fma3-no}"
diff --git a/doc/APIchanges b/doc/APIchanges
index 119d117..c55dfe8 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2015-10-27 - xxx - lavu 55.5.100 - cpu.h
+  Add AV_CPU_FLAG_AESNI.
+
 2015-10-27 - xxx - lavc 57.12.100 / 57.8.0 - avcodec.h
   Deprecate av_free_packet(). Use av_packet_unref() as replacement,
   it resets the packet in a more consistent way.
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index c64baf9..1acae01 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -118,6 +118,7 @@ int av_parse_cpu_flags(const char *s)
 #define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX)
 #define CPUFLAG_AVX2 (AV_CPU_FLAG_AVX2 | CPUFLAG_AVX)
 #define CPUFLAG_BMI2 (AV_CPU_FLAG_BMI2 | AV_CPU_FLAG_BMI1)
+#define CPUFLAG_AESNI(AV_CPU_FLAG_AESNI| CPUFLAG_SSE42)
 static const AVOption cpuflags_opts[] = {
 { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, 
INT64_MAX, .unit = "flags" },
 #if   ARCH_PPC
@@ -145,6 +146,7 @@ int av_parse_cpu_flags(const char *s)
 { "3dnow"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW   
 },.unit = "flags" },
 { "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT
 },.unit = "flags" },
 { "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV
 },.unit = "flags" },
+{ "aesni"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AESNI   
 },.unit = "flags" },
 #elif ARCH_ARM
 { "armv5te",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV5TE 
 },.unit = "flags" },
 { "armv6",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV6   
 },.unit = "flags" },
@@ -205,6 +207,7 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
 { "3dnow"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_3DNOW   
 },.unit = "flags" },
 { "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
AV_CPU_FLAG_3DNOWEXT },.unit = "flags" },
 { "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV
 },.unit = "flags" },
+{ "aesni",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_AESNI   
 },.unit = "flags" },
 
 #define CPU_FLAG_P2 AV_CPU_FLAG_CMOV | AV_CPU_FLAG_MMX
 #define CPU_FLAG_P3 CPU_FLAG_P2 | AV_CPU_FLAG_MMX2 | AV_CPU_FLAG_SSE
@@ -340,6 +343,7 @@ static const struct {
 { AV_CPU_FLAG_AVX2,  "avx2"   },
 { AV_CPU_FLAG_BMI1,  "bmi1"   },
 { AV_CPU_FLAG_BMI2,  "bmi2"   },
+{ AV_CPU_FLAG_AESNI, "aesni"  },
 #endif
 { 0 }
 };
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index 9403eca..bff8518 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -42,6 +42,7 @@
 #define AV_CPU_FLAG_ATOM 0x1000 ///< Atom processor, some SSSE3 
instructions are slower
 #define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
 #define AV_CPU_FLAG_SSE420x0200 ///< Nehalem SSE4.2 functions
+#define AV_CPU_FLAG_AESNI   0x8 ///< Advanced

[FFmpeg-cvslog] lavu/aes: align AVAES struct members

2015-10-28 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Sun Oct 11 
22:15:08 2015 -0500| [54cd1ab55513e0a12f90dba8036b0a54b16d8ff7] | committer: 
Rodger Combs

lavu/aes: align AVAES struct members

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=54cd1ab55513e0a12f90dba8036b0a54b16d8ff7
---

 libavutil/aes_internal.h |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavutil/aes_internal.h b/libavutil/aes_internal.h
index e5bf4bd..4944258 100644
--- a/libavutil/aes_internal.h
+++ b/libavutil/aes_internal.h
@@ -21,6 +21,7 @@
 #ifndef AVUTIL_AES_INTERNAL_H
 #define AVUTIL_AES_INTERNAL_H
 
+#include "mem.h"
 #include 
 
 typedef union {
@@ -33,8 +34,8 @@ typedef union {
 typedef struct AVAES {
 // Note: round_key[16] is accessed in the init code, but this only
 // overwrites state, which does not matter (see also commit ba554c0).
-av_aes_block round_key[15];
-av_aes_block state[2];
+DECLARE_ALIGNED(16, av_aes_block, round_key)[15];
+DECLARE_ALIGNED(16, av_aes_block, state)[2];
 int rounds;
 void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int 
count, uint8_t *iv, int rounds);
 } AVAES;

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


[FFmpeg-cvslog] lavu/aes: move AVAES to separate internal header

2015-10-28 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Sun Oct 11 
22:12:16 2015 -0500| [ec588db56fdc21606a8c8b9b32f4a54aacbe7aca] | committer: 
Rodger Combs

lavu/aes: move AVAES to separate internal header

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec588db56fdc21606a8c8b9b32f4a54aacbe7aca
---

 libavutil/aes.c  |   16 +---
 libavutil/aes_internal.h |   41 +
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/libavutil/aes.c b/libavutil/aes.c
index b59e7de..61e9dd1 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -22,24 +22,10 @@
 
 #include "common.h"
 #include "aes.h"
+#include "aes_internal.h"
 #include "intreadwrite.h"
 #include "timer.h"
 
-typedef union {
-uint64_t u64[2];
-uint32_t u32[4];
-uint8_t u8x4[4][4];
-uint8_t u8[16];
-} av_aes_block;
-
-typedef struct AVAES {
-// Note: round_key[16] is accessed in the init code, but this only
-// overwrites state, which does not matter (see also commit ba554c0).
-av_aes_block round_key[15];
-av_aes_block state[2];
-int rounds;
-} AVAES;
-
 const int av_aes_size= sizeof(AVAES);
 
 struct AVAES *av_aes_alloc(void)
diff --git a/libavutil/aes_internal.h b/libavutil/aes_internal.h
new file mode 100644
index 000..e2841ef
--- /dev/null
+++ b/libavutil/aes_internal.h
@@ -0,0 +1,41 @@
+/*
+ * copyright (c) 2015 Rodger Combs 
+ *
+ * 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
+ */
+
+#ifndef AVUTIL_AES_INTERNAL_H
+#define AVUTIL_AES_INTERNAL_H
+
+#include 
+
+typedef union {
+uint64_t u64[2];
+uint32_t u32[4];
+uint8_t u8x4[4][4];
+uint8_t u8[16];
+} av_aes_block;
+
+typedef struct AVAES {
+// Note: round_key[16] is accessed in the init code, but this only
+// overwrites state, which does not matter (see also commit ba554c0).
+av_aes_block round_key[15];
+av_aes_block state[2];
+int rounds;
+} AVAES;
+
+#endif /* AVUTIL_AES_INTERNAL_H */

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


[FFmpeg-cvslog] lavu/aes: add runtime dispatch for crypt function

2015-10-28 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Sun Oct 11 
22:14:20 2015 -0500| [15ff5c7215def8e6bc38f6b84526fb1266c09dc3] | committer: 
Rodger Combs

lavu/aes: add runtime dispatch for crypt function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15ff5c7215def8e6bc38f6b84526fb1266c09dc3
---

 libavutil/aes.c  |   49 ++
 libavutil/aes_internal.h |1 +
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/libavutil/aes.c b/libavutil/aes.c
index 61e9dd1..dde15be 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -126,31 +126,44 @@ static inline void aes_crypt(AVAES *a, int s, const 
uint8_t *sbox,
 subshift(&a->state[0], s, sbox);
 }
 
-void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src,
-  int count, uint8_t *iv, int decrypt)
+static void aes_encrypt(AVAES *a, uint8_t *dst, const uint8_t *src,
+int count, uint8_t *iv, int rounds)
 {
 while (count--) {
-addkey_s(&a->state[1], src, &a->round_key[a->rounds]);
-if (decrypt) {
-aes_crypt(a, 0, inv_sbox, dec_multbl);
-if (iv) {
-addkey_s(&a->state[0], iv, &a->state[0]);
-memcpy(iv, src, 16);
-}
-addkey_d(dst, &a->state[0], &a->round_key[0]);
-} else {
-if (iv)
-addkey_s(&a->state[1], iv, &a->state[1]);
-aes_crypt(a, 2, sbox, enc_multbl);
-addkey_d(dst, &a->state[0], &a->round_key[0]);
-if (iv)
-memcpy(iv, dst, 16);
+addkey_s(&a->state[1], src, &a->round_key[rounds]);
+if (iv)
+addkey_s(&a->state[1], iv, &a->state[1]);
+aes_crypt(a, 2, sbox, enc_multbl);
+addkey_d(dst, &a->state[0], &a->round_key[0]);
+if (iv)
+memcpy(iv, dst, 16);
+src += 16;
+dst += 16;
+}
+}
+
+static void aes_decrypt(AVAES *a, uint8_t *dst, const uint8_t *src,
+int count, uint8_t *iv, int rounds)
+{
+while (count--) {
+addkey_s(&a->state[1], src, &a->round_key[rounds]);
+aes_crypt(a, 0, inv_sbox, dec_multbl);
+if (iv) {
+addkey_s(&a->state[0], iv, &a->state[0]);
+memcpy(iv, src, 16);
 }
+addkey_d(dst, &a->state[0], &a->round_key[0]);
 src += 16;
 dst += 16;
 }
 }
 
+void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src,
+  int count, uint8_t *iv, int decrypt)
+{
+a->crypt(a, dst, src, count, iv, a->rounds);
+}
+
 static void init_multbl2(uint32_t tbl[][256], const int c[4],
  const uint8_t *log8, const uint8_t *alog8,
  const uint8_t *sbox)
@@ -186,6 +199,8 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, 
int decrypt)
 uint8_t log8[256];
 uint8_t alog8[512];
 
+a->crypt = decrypt ? aes_decrypt : aes_encrypt;
+
 if 
(!enc_multbl[FF_ARRAY_ELEMS(enc_multbl)-1][FF_ARRAY_ELEMS(enc_multbl[0])-1]) {
 j = 1;
 for (i = 0; i < 255; i++) {
diff --git a/libavutil/aes_internal.h b/libavutil/aes_internal.h
index e2841ef..e5bf4bd 100644
--- a/libavutil/aes_internal.h
+++ b/libavutil/aes_internal.h
@@ -36,6 +36,7 @@ typedef struct AVAES {
 av_aes_block round_key[15];
 av_aes_block state[2];
 int rounds;
+void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int 
count, uint8_t *iv, int rounds);
 } AVAES;
 
 #endif /* AVUTIL_AES_INTERNAL_H */

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


[FFmpeg-cvslog] ffprobe: Remove abort()

2015-10-28 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Oct 28 10:11:22 2015 +0100| [057ce755b9370629bcc840c998d5344099e46183] | 
committer: Michael Niedermayer

ffprobe: Remove abort()

Found-by: Ganesh Ajjanagadde and wm4
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=057ce755b9370629bcc840c998d5344099e46183
---

 ffprobe.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/ffprobe.c b/ffprobe.c
index 02e2c48..92c7fa6 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1890,7 +1890,6 @@ static void show_frame(WriterContext *w, AVFrame *frame, 
AVStream *stream,
 print_str("side_data_type", name ? name : "unknown");
 print_int("side_data_size", sd->size);
 if (sd->type == AV_FRAME_DATA_DISPLAYMATRIX && sd->size >= 9*4) {
-abort();
 writer_print_integers(w, "displaymatrix", sd->data, 9, " 
%11d", 3, 4, 1);
 print_int("rotation", av_display_rotation_get((int32_t 
*)sd->data));
 }

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