Re: [FFmpeg-devel] [PATCHv3] mov: Evaluate the movie display matrix

2016-10-18 Thread Benoit Fouet
Hi,

On 14/10/2016 00:50, Vittorio Giovara wrote:
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index a15c8d1..e8da77f 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c

[...]

> @@ -3798,16 +3804,33 @@ static int mov_read_meta(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  return 0;
>  }
>  
> +// return 0 when matrix is identity, 1 otherwise
> +#define IS_MATRIX_FULL(matrix)   \
> +(matrix[0][0] != (1 << 16) ||\
> + matrix[1][1] != (1 << 16) ||\
> + matrix[2][2] != (1 << 30) ||\
> + matrix[0][1] || matrix[0][2] || \
> + matrix[1][0] || matrix[1][2] || \
> + matrix[2][0] || matrix[2][1])
> +

should be "(matrix)" everywhere
Also, reversing the logic would allow preventing the evaluation of all
conditions when the matrix is not identity (i.e. making it
IS_MATRIX_IDENTITY)

> +// fixed point to double
> +#define CONV_FP(x, sh) ((double) (x)) / (1 << (sh))
> +

((double) (x) / (1 << (sh)))

> +// double to fixed point
> +#define CONV_DB(x, sh) ((int32_t) ((x) * (1 << (sh
> +

Cheers,
-- 
Ben


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


Re: [FFmpeg-devel] [PATCHv3] mov: Evaluate the movie display matrix

2016-10-17 Thread Vittorio Giovara
On Thu, Oct 13, 2016 at 6:50 PM, Vittorio Giovara
 wrote:
> This matrix needs to be applied after all others have (currently only
> display matrix from trak), but cannot be handled in movie box, since
> streams are not allocated yet. So store it in main context, and apply
> it when appropriate, that is after parsing the tkhd one.
>
> Signed-off-by: Vittorio Giovara 
> ---
> Reworked second matrix handling so that it is always applied, which makes
> the code easier to read and test. Updated according reviews, rolled back
> a couple of points for the reasons explained in the thread.
>
> Needs a new sample to be uploaded to fate,
> https://www.dropbox.com/s/qfio4bjhkpz3p4o/displaymatrix.mov?dl=0,
> the previous one can be deleted.
>
> Cheers,
> Vittorio
>
>  libavformat/isom.h|  2 ++
>  libavformat/mov.c | 53 
> +++
>  tests/fate/mov.mak|  6 -
>  tests/ref/fate/mov-display-matrix | 10 
>  4 files changed, 59 insertions(+), 12 deletions(-)
>  create mode 100644 tests/ref/fate/mov-display-matrix

Ping? Please cc me or i might miss replies.
Thanks
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel