Re: [libav-devel] [PATCH] Added parameter -hls_allow_cache

2014-10-01 Thread Martin Storsjö

Hi Joakim,

On Thu, 2 Oct 2014, Joakim Roubert wrote:


On 2014-09-19 10:01, Joakim Roubert wrote:

The -hls_allow_cache parameter enables explicitly setting the

[...]

Just about 2 weeks since this latest patch was posted as a response to
the last comments seen here. Is this ready for merge now?


I haven't received any updated patch from you, and I can't find it on 
https://lists.libav.org/pipermail/libav-devel/2014-September/ either - it 
seems like your updated patch submission got lost somewhere. Can you 
resend it?


// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Added parameter -hls_allow_cache

2014-10-01 Thread Joakim Roubert
On 2014-09-19 10:01, Joakim Roubert wrote:
> The -hls_allow_cache parameter enables explicitly setting the
[...]

Just about 2 weeks since this latest patch was posted as a response to
the last comments seen here. Is this ready for merge now?

BR,

/Joakim
-- 
 http://www.df.lth.se/~jokke/
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] jpeg2000: split off inverse MCT decoding as Jpeg2000DSP

2014-10-01 Thread Nicolas Bertrand

Le 01/10/2014 22:27, Luca Barbato a écrit :

On 01/10/14 22:16, James Almer wrote:

This makes the addition of arch optimized functions easier.



Looks good to me.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

also to me

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] jpeg2000: split off inverse MCT decoding as Jpeg2000DSP

2014-10-01 Thread Luca Barbato

On 01/10/14 22:16, James Almer wrote:

This makes the addition of arch optimized functions easier.



Looks good to me.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] jpeg2000: split off inverse MCT decoding as Jpeg2000DSP

2014-10-01 Thread James Almer
This makes the addition of arch optimized functions easier.

Signed-off-by: James Almer 
---
 libavcodec/Makefile  |  2 +-
 libavcodec/jpeg2000dec.c | 72 +--
 libavcodec/jpeg2000dsp.c | 98 
 libavcodec/jpeg2000dsp.h | 35 +
 libavcodec/jpeg2000dwt.h |  3 +-
 5 files changed, 154 insertions(+), 56 deletions(-)
 create mode 100644 libavcodec/jpeg2000dsp.c
 create mode 100644 libavcodec/jpeg2000dsp.h

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 178b61e..69b92b6 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -229,7 +229,7 @@ OBJS-$(CONFIG_INDEO4_DECODER)  += indeo4.o 
ivi_common.o ivi_dsp.o
 OBJS-$(CONFIG_INDEO5_DECODER)  += indeo5.o ivi_common.o ivi_dsp.o
 OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER)  += dpcm.o
 OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
-OBJS-$(CONFIG_JPEG2000_DECODER)+= jpeg2000dec.o jpeg2000.o  \
+OBJS-$(CONFIG_JPEG2000_DECODER)+= jpeg2000dec.o jpeg2000.o 
jpeg2000dsp.o \
   jpeg2000dwt.o mqcdec.o mqc.o
 OBJS-$(CONFIG_JPEGLS_DECODER)  += jpeglsdec.o jpegls.o
 OBJS-$(CONFIG_JPEGLS_ENCODER)  += jpeglsenc.o jpegls.o
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index aed9b2b..5135297 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -35,6 +35,7 @@
 #include "internal.h"
 #include "thread.h"
 #include "jpeg2000.h"
+#include "jpeg2000dsp.h"
 
 #define JP2_SIG_TYPE0x6A502020
 #define JP2_SIG_VALUE   0x0D0A870A
@@ -85,6 +86,7 @@ typedef struct Jpeg2000DecoderContext {
 
 int16_t curtileno;
 Jpeg2000Tile*tile;
+Jpeg2000DSPContext dsp;
 
 /*options parameters*/
 int reduction_factor;
@@ -1041,69 +1043,21 @@ static void dequantization_int(int x, int y, 
Jpeg2000Cblk *cblk,
 }
 }
 
-/* Inverse ICT parameters in float and integer.
- * int value = (float value) * (1<<16) */
-static const float f_ict_params[4] = {
-1.402f,
-0.34413f,
-0.71414f,
-1.772f
-};
-static const int   i_ict_params[4] = {
- 91881,
- 22553,
- 46802,
-116130
-};
-
-static void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
+static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
 {
 int i, csize = 1;
-int32_t *src[3],  i0,  i1,  i2;
-float   *srcf[3], i0f, i1f, i2f;
+void *src[3];
 
 for (i = 0; i < 3; i++)
 if (tile->codsty[0].transform == FF_DWT97)
-srcf[i] = tile->comp[i].f_data;
+src[i] = tile->comp[i].f_data;
 else
-src [i] = tile->comp[i].i_data;
+src[i] = tile->comp[i].i_data;
 
 for (i = 0; i < 2; i++)
 csize *= tile->comp[0].coord[i][1] - tile->comp[0].coord[i][0];
-switch (tile->codsty[0].transform) {
-case FF_DWT97:
-for (i = 0; i < csize; i++) {
-i0f = *srcf[0] + (f_ict_params[0] * *srcf[2]);
-i1f = *srcf[0] - (f_ict_params[1] * *srcf[1])
-   - (f_ict_params[2] * *srcf[2]);
-i2f = *srcf[0] + (f_ict_params[3] * *srcf[1]);
-*srcf[0]++ = i0f;
-*srcf[1]++ = i1f;
-*srcf[2]++ = i2f;
-}
-break;
-case FF_DWT97_INT:
-for (i = 0; i < csize; i++) {
-i0 = *src[0] + (((i_ict_params[0] * *src[2]) + (1 << 15)) >> 16);
-i1 = *src[0] - (((i_ict_params[1] * *src[1]) + (1 << 15)) >> 16)
- - (((i_ict_params[2] * *src[2]) + (1 << 15)) >> 16);
-i2 = *src[0] + (((i_ict_params[3] * *src[1]) + (1 << 15)) >> 16);
-*src[0]++ = i0;
-*src[1]++ = i1;
-*src[2]++ = i2;
-}
-break;
-case FF_DWT53:
-for (i = 0; i < csize; i++) {
-i1 = *src[0] - (*src[2] + *src[1] >> 2);
-i0 = i1 + *src[2];
-i2 = i1 + *src[1];
-*src[0]++ = i0;
-*src[1]++ = i1;
-*src[2]++ = i2;
-}
-break;
-}
+
+s->dsp.mct_decode[tile->codsty[0].transform](src[0], src[1], src[2], 
csize);
 }
 
 static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
@@ -1406,6 +1360,15 @@ static int jp2_find_codestream(Jpeg2000DecoderContext *s)
 return 0;
 }
 
+static av_cold int jpeg2000_decode_init(AVCodecContext *avctx)
+{
+Jpeg2000DecoderContext *s = avctx->priv_data;
+
+ff_jpeg2000dsp_init(&s->dsp);
+
+return 0;
+}
+
 static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
  int *got_frame, AVPacket *avpkt)
 {
@@ -1510,6 +1473,7 @@ AVCodec ff_jpeg2000_decoder = {
 .capabilities = CODEC_CAP_FRAME_THREADS,
 .priv_data_size   = sizeof(Jpeg2000DecoderContext),
 .init_static_data = jpeg2000_init_static_data,
+.init = jpeg2000_decode_init,
 .decode   = j

Re: [libav-devel] [PATCH] x86: h264_intrapred: Don't treat 32-bit integers as 64-bit

2014-10-01 Thread Luca Barbato

On 01/10/14 19:03, Henrik Gramner wrote:

The upper halves are not guaranteed to be zero in x86-64.
---
  libavcodec/x86/h264_intrapred.asm | 98 +++
  1 file changed, 49 insertions(+), 49 deletions(-)



Sounds sensible.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] x86: h264_intrapred: Don't treat 32-bit integers as 64-bit

2014-10-01 Thread Henrik Gramner
The upper halves are not guaranteed to be zero in x86-64.
---
 libavcodec/x86/h264_intrapred.asm | 98 +++
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/libavcodec/x86/h264_intrapred.asm 
b/libavcodec/x86/h264_intrapred.asm
index 4a4fa10..df657a4 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -1027,9 +1027,9 @@ cglobal pred8x8l_top_dc_8, 4,4
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1 ; top_left
+testr1d, r1d ; top_left
 jz .fix_lt_2
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jz .fix_tr_1
 jmp .body
 .fix_lt_2:
@@ -1038,7 +1038,7 @@ cglobal pred8x8l_top_dc_8, 4,4
 psllq   mm5, 56
 psrlq   mm5, 56
 pxormm2, mm5
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jnz .body
 .fix_tr_1:
 movqmm5, mm3
@@ -1099,7 +1099,7 @@ cglobal pred8x8l_dc_8, 4,5
 movqmm2, mm3
 PALIGNR mm4, mm0, 7, mm0
 PALIGNR mm1, mm2, 1, mm2
-testr1, r1
+testr1d, r1d
 jnz .do_left
 .fix_lt_1:
 movqmm5, mm3
@@ -1114,7 +1114,7 @@ cglobal pred8x8l_dc_8, 4,5
 psllq   mm5, 56
 psrlq   mm5, 56
 pxormm2, mm5
-test r2, r2
+testr2d, r2d
 jnz .body
 .fix_tr_1:
 movqmm5, mm3
@@ -1138,9 +1138,9 @@ cglobal pred8x8l_dc_8, 4,5
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1
+testr1d, r1d
 jz .fix_lt_2
-test r2, r2
+testr2d, r2d
 jz .fix_tr_1
 .body:
 lea  r1, [r0+r3*2]
@@ -1182,7 +1182,7 @@ cglobal pred8x8l_horizontal_8, 4,4
 sub  r0, r3
 lea  r2, [r0+r3*2]
 movqmm0, [r0+r3*1-8]
-test r1, r1
+testr1d, r1d
 lea  r1, [r0+r3]
 cmovnz   r1, r0
 punpckhbw   mm0, [r1+r3*0-8]
@@ -1259,9 +1259,9 @@ cglobal pred8x8l_vertical_8, 4,4
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1 ; top_left
+testr1d, r1d ; top_left
 jz .fix_lt_2
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jz .fix_tr_1
 jmp .body
 .fix_lt_2:
@@ -1270,7 +1270,7 @@ cglobal pred8x8l_vertical_8, 4,4
 psllq   mm5, 56
 psrlq   mm5, 56
 pxormm2, mm5
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jnz .body
 .fix_tr_1:
 movqmm5, mm3
@@ -1310,9 +1310,9 @@ cglobal pred8x8l_down_left_8, 4,5
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1
+testr1d, r1d
 jz .fix_lt_2
-test r2, r2
+testr2d, r2d
 jz .fix_tr_1
 jmp .do_top
 .fix_lt_2:
@@ -1321,7 +1321,7 @@ cglobal pred8x8l_down_left_8, 4,5
 psllq   mm5, 56
 psrlq   mm5, 56
 pxormm2, mm5
-test r2, r2
+testr2d, r2d
 jnz .do_top
 .fix_tr_1:
 movqmm5, mm3
@@ -1337,7 +1337,7 @@ cglobal pred8x8l_down_left_8, 4,5
 .do_top:
 PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
 movqmm7, mm4
-test r2, r2
+testr2d, r2d
 jz .fix_tr_2
 movqmm0, [r0+8]
 movqmm5, mm0
@@ -1418,9 +1418,9 @@ cglobal pred8x8l_down_left_8, 4,4
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1 ; top_left
+testr1d, r1d ; top_left
 jz .fix_lt_2
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jz .fix_tr_1
 jmp .do_top
 .fix_lt_2:
@@ -1429,7 +1429,7 @@ cglobal pred8x8l_down_left_8, 4,4
 psllq   mm5, 56
 psrlq   mm5, 56
 pxormm2, mm5
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jnz .do_top
 .fix_tr_1:
 movqmm5, mm3
@@ -1445,7 +1445,7 @@ cglobal pred8x8l_down_left_8, 4,4
 .do_top:
 PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
 movq2dqxmm3, mm4
-test r2, r2 ; top_right
+testr2d, r2d ; top_right
 jz .fix_tr_2
 movqmm0, [r0+8]
 movqmm5, mm0
@@ -1527,7 +1527,7 @@ cglobal pred8x8l_down_right_8, 4,5
 movqmm2, mm3
 PALIGNR mm4, mm0, 7, mm0
 PALIGNR mm1, mm2, 1, mm2
-testr1, r1 ; top_left
+testr1d, r1d ; top_left
 jz .fix_lt_1
 .do_left:
 movqmm0, mm4
@@ -1545,9 +1545,9 @@ cglobal pred8x8l_down_right_8, 4,5
 movqmm4, mm3
 PALIGNR mm2, mm0, 7, mm0
 PALIGNR mm1, mm4, 1, mm4
-test r1, r1 ; top_left
+testr1d, r1d ; top_left
 jz .fix_lt_2
-test r2, r2 ; top_right
+te

Re: [libav-devel] [PATCH] Reset mutex to NULL after mutex destruction.

2014-10-01 Thread Luca Barbato

On 01/10/14 00:34, Manfred Georg wrote:

I had forgotten to subscribe to the list so I was left off of the thread.


Ah, forgot to put you on CC. Sorry.


Although I believe this patch improves the code


It does. Beside the small issue on the failure path for the mutex 
allocation.


lu




___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avcodec: Reset mutex to NULL on mutex destruction

2014-10-01 Thread Luca Barbato

On 30/09/14 08:30, Anton Khirnov wrote:

Quoting Luca Barbato (2014-09-30 02:00:50)

From: Manfred Georg 

A badly behaving user provided mutex manager (such as that in OpenCV)
may not reset the mutex to NULL on destruction.

This can cause a problem for a later mutex manager
(which may assert that the mutex is NULL before creating).

Signed-off-by: Manfred Georg 
Signed-off-by: Luca Barbato 
---

Review in patch form:
* We normally use ret for keeping the return value
* We tend to align =


libavcodec/utils.c | 18 --
  1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a472076..204d80b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2317,19 +2317,25 @@ AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel)

  int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
  {
+int ret;
+
  if (lockmgr_cb) {
-if (lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY))
-return -1;
-if (lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY))
+void *old_codec_mutex= codec_mutex;
+void *old_avformat_mutex = avformat_mutex;
+
+codec_mutex= NULL;
+avformat_mutex = NULL;
+
+ret = lockmgr_cb(&old_codec_mutex, AV_LOCK_DESTROY);
+if (lockmgr_cb(&old_avformat_mutex, AV_LOCK_DESTROY) || ret)
  return -1;
  }

  lockmgr_cb = cb;

  if (lockmgr_cb) {
-if (lockmgr_cb(&codec_mutex, AV_LOCK_CREATE))
-return -1;
-if (lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE))
+ret = lockmgr_cb(&codec_mutex, AV_LOCK_CREATE);
+if (lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE) || ret)


What's the point of creating the lavf lock, if the lavc one failed? The
current code does not do that.


Me blindly matching the lines above and the original author doing the 
same I guess.


I'd switch it to if (ret || lockmgr_cb()) and accept it, it does improve 
a bit the situation IMHO.


lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel