Re: [libav-devel] [PATCH 2/2] mlpdec_parser: fix a few channel layouts.

2012-02-22 Thread Justin Ruggles
On 02/22/2012 10:09 AM, Tim W wrote:

> ---
>  libavcodec/mlp_parser.c |9 +
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
> index be71867..3bf38c7 100644
> --- a/libavcodec/mlp_parser.c
> +++ b/libavcodec/mlp_parser.c
> @@ -79,13 +79,13 @@ static const uint64_t thd_layout[13] = {
>  AV_CH_LOW_FREQUENCY,// LFE
>  AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRs
>  AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT, // LRvh
> -AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRc
> +AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
>  AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT,   // LRrs
>  AV_CH_BACK_CENTER,  // Cs
>  AV_CH_TOP_BACK_CENTER,  // Ts
>  AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRsd
> -AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRw
> -AV_CH_TOP_BACK_CENTER,  // Cvh
> +AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT,   // LRw
> +AV_CH_TOP_FRONT_CENTER, // Cvh
>  AV_CH_LOW_FREQUENCY // LFE2
>  };
>  
> @@ -109,7 +109,8 @@ static int truehd_channels(int chanmap)
>  
>  static uint64_t truehd_layout(int chanmap)
>  {
> -int layout = 0, i;
> +int i;
> +uint64_t layout = 0;
>  
>  for (i = 0; i < 13; i++)
>  layout |= thd_layout[i] * ((chanmap >> i) & 1);


LGTM.

Thanks,
Justin

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


[libav-devel] [PATCH 2/2] mlpdec_parser: fix a few channel layouts.

2012-02-22 Thread Tim W
---
 libavcodec/mlp_parser.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index be71867..3bf38c7 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -79,13 +79,13 @@ static const uint64_t thd_layout[13] = {
 AV_CH_LOW_FREQUENCY,// LFE
 AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRs
 AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT, // LRvh
-AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRc
+AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
 AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT,   // LRrs
 AV_CH_BACK_CENTER,  // Cs
 AV_CH_TOP_BACK_CENTER,  // Ts
 AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRsd
-AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRw
-AV_CH_TOP_BACK_CENTER,  // Cvh
+AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT,   // LRw
+AV_CH_TOP_FRONT_CENTER, // Cvh
 AV_CH_LOW_FREQUENCY // LFE2
 };
 
@@ -109,7 +109,8 @@ static int truehd_channels(int chanmap)
 
 static uint64_t truehd_layout(int chanmap)
 {
-int layout = 0, i;
+int i;
+uint64_t layout = 0;
 
 for (i = 0; i < 13; i++)
 layout |= thd_layout[i] * ((chanmap >> i) & 1);
-- 
1.7.5.4

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


[libav-devel] [PATCH 2/2] mlpdec_parser: fix a few channel layouts.

2012-02-22 Thread Tim W
truehd_layout(): layout variable should be uint64_t to work with 
AV_CH_WIDE_LEFT etc.

This patch fixes the following samples:

Sample 1 (TrueHD, L R C LFE Ls Rs Lc Rc)


http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7front1.png
http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7front1.mka

Before patch:

avconv -i SpeakerID-7front1.mka 
avconv version v0.8-634-g535a80c, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:47:55 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7f936981ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7front1.mka':
  Duration: 00:00:31.66, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 8 channels (FL|FR|FC|LFE|SL|SR), 
s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR (, SL, SR) - incorrect (see PNG)

After patch:

avconv -i SpeakerID-7front1.mka 
avconv version v0.8-635-gda78073, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:55:32 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7ff6e281ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7front1.mka':
  Duration: 00:00:31.66, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 7.1(wide), s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR, FLC, FRC - correct (see PNG)

Sample 2 (TrueHD, L R C LFE Ls Rs Lw Rw)


http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7wide1.png
http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7wide1.mka

Before patch:

avconv -i SpeakerID-7wide1.mka 
avconv version v0.8-634-g535a80c, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:47:55 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7fbaa181ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7wide1.mka':
  Duration: 00:00:34.86, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 7.1(wide), s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR, FLC, FRC - incorrect (see PNG)

After patch:

avconv -i SpeakerID-7wide1.mka 
avconv version v0.8-635-gda78073, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:55:32 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7fdfc201ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7wide1.mka':
  Duration: 00:00:34.86, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 8 channels 
(FL|FR|FC|LFE|SL|SR|WL|WR), s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR, WL, WR - correct (see PNG)

Sample 3 (TrueHD, L R C LFE Ls Rs Cvh Ts)
-

http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7top1back.png
http://dl.dropbox.com/u/37259775/audio/truehd/SpeakerID-7top1back.mka

Before patch:

avconv -i SpeakerID-7top1back.mka 
avconv version v0.8-634-g535a80c, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:47:55 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7f93db81ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7top1back.mka':
  Duration: 00:00:34.81, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 8 channels 
(FL|FR|FC|LFE|SL|SR|TBC), s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR, TBC (, TBC) - incorrect (see PNG)

After patch:

avconv -i SpeakerID-7top1back.mka 
avconv version v0.8-635-gda78073, Copyright (c) 2000-2012 the Libav developers
  built on Feb 22 2012 15:55:32 with llvm_gcc 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2336.1.00)
[matroska,webm @ 0x7fca6281ae00] Estimating duration from bitrate, this may be 
inaccurate
Input #0, matroska,webm, from 'SpeakerID-7top1back.mka':
  Duration: 00:00:34.81, start: 0.00, bitrate: N/A
Stream #0.0(eng): Audio: truehd, 48000 Hz, 8 channels 
(FL|FR|FC|LFE|SL|SR|TFC|TBC), s32 (default)
At least one output file must be specified

FL, FR, FC, LFE, SL, SR, TFC, TBC - (seems) correct (see PNG)

I also believe:

AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,   // LRsd

should be:

AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd

but I have no samples to test with so I left it out of the patch.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel