Commit a3c92b8f authored by Henri Fallon's avatar Henri Fallon

Added LPCM support. It should work with stereo LPCM.
Untested with 5-ways LPCM streams.
parent b947d063
...@@ -77,7 +77,6 @@ AC3_SPDIF := src/ac3_spdif/ac3_spdif.o \ ...@@ -77,7 +77,6 @@ AC3_SPDIF := src/ac3_spdif/ac3_spdif.o \
src/ac3_spdif/ac3_iec958.o src/ac3_spdif/ac3_iec958.o
LPCM_DECODER := src/lpcm_decoder/lpcm_decoder_thread.o \ LPCM_DECODER := src/lpcm_decoder/lpcm_decoder_thread.o \
src/lpcm_decoder/lpcm_decoder.o
AUDIO_DECODER := src/audio_decoder/audio_decoder.o \ AUDIO_DECODER := src/audio_decoder/audio_decoder.o \
src/audio_decoder/adec_generic.o \ src/audio_decoder/adec_generic.o \
......
...@@ -56,7 +56,7 @@ Description: Cope with vls/vlc clock jitter ...@@ -56,7 +56,7 @@ Description: Cope with vls/vlc clock jitter
The internal clocks of the server and the client are not assured to be The internal clocks of the server and the client are not assured to be
in perfect synchronization, which may be annoying when playing a movie. in perfect synchronization, which may be annoying when playing a movie.
Reduce this jitter by using a well-chosen filter. Reduce this jitter by using a well-chosen filter.
Status: Todo Status: Done 1 May 2001 (henri)
Task: 0x58 Task: 0x58
Difficulty: Medium Difficulty: Medium
...@@ -541,7 +541,7 @@ Urgency: Normal ...@@ -541,7 +541,7 @@ Urgency: Normal
Description: LPCM decoder Description: LPCM decoder
The LPCM decoder is full of stubs, it only parses the stream The LPCM decoder is full of stubs, it only parses the stream
but does not decode it. Fix this. but does not decode it. Fix this.
Status: Todo Status: Done 12 Jun 2001 (henri)
Task: 0x1c Task: 0x1c
Difficulty: Guru Difficulty: Guru
......
/*****************************************************************************
* lpcm_decoder.c: core lpcm decoder
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder.c,v 1.7 2001/04/06 09:15:48 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "defs.h"
#include <stdio.h>
#include <string.h> /* memcpy(), memset() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "intf_msg.h"
//#include "int_types.h"
#include "lpcm_decoder.h"
int lpcm_init (lpcmdec_t * p_lpcmdec)
{
intf_DbgMsg( "LPCM Debug: lpmcm init called" );
return 0;
}
int lpcm_decode_frame (lpcmdec_t * p_lpcmdec, s16 * buffer)
{
/*
* XXX was part of ac3dec, is to change
int i;
if (parse_bsi (p_ac3dec))
return 1;
for (i = 0; i < 6; i++) {
if (parse_audblk (p_ac3dec, i))
return 1;
if (exponent_unpack (p_ac3dec))
return 1;
bit_allocate (p_ac3dec);
mantissa_unpack (p_ac3dec);
if (p_ac3dec->bsi.acmod == 0x2)
rematrix (p_ac3dec);
imdct (p_ac3dec);
downmix (p_ac3dec, buffer);
buffer += 2*256;
}
parse_auxdata (p_ac3dec);
*/
return 0;
}
/*****************************************************************************
* lpcm_decoder.h : lpcm decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder.h,v 1.3 2001/03/21 13:42:34 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*****************************************************************************/
typedef struct lpcmdec_s lpcmdec_t;
typedef struct lpcm_sync_info_s {
int sample_rate; /* sample rate in Hz */
int frame_size; /* frame size in bytes */
int bit_rate; /* nominal bit rate in kbps */
} lpcm_sync_info_t;
typedef struct lpcm_byte_stream_s {
u8 * p_byte;
u8 * p_end;
void * info;
} lpcm_byte_stream_t;
int lpcm_init (lpcmdec_t * p_lpcmdec);
int lpcm_sync_frame (lpcmdec_t * p_lpcmdec, lpcm_sync_info_t * p_sync_info);
int lpcm_decode_frame (lpcmdec_t * p_lcpmdec, s16 * buffer);
//static lpcm_byte_stream_t * lpcm_byte_stream (lcpmdec_t * p_lpcmdec);
void lpcm_byte_stream_next (lpcm_byte_stream_t * p_byte_stream);
typedef struct lpcm_bit_stream_s {
u32 buffer;
int i_available;
lpcm_byte_stream_t byte_stream;
} lpcm_bit_stream_t;
struct lpcmdec_s {
/*
* Input properties
*/
/* The bit stream structure handles the PES stream at the bit level */
lpcm_bit_stream_t bit_stream;
};
static lpcm_byte_stream_t * lpcm_byte_stream (lpcmdec_t * p_lpcmdec)
{
return &(p_lpcmdec->bit_stream.byte_stream);
}
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm_decoder_thread.h : lpcm decoder thread interface * lpcm_decoder_thread.h : lpcm decoder thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.h,v 1.5 2001/05/01 04:18:18 sam Exp $ * $Id: lpcm_decoder_thread.h,v 1.6 2001/06/12 13:50:09 henri Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*****************************************************************************/ *****************************************************************************/
#define LPCMDEC_FRAME_SIZE (2008)
/***************************************************************************** /*****************************************************************************
* lpcmdec_thread_t : lpcm decoder thread descriptor * lpcmdec_thread_t : lpcm decoder thread descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -40,20 +42,17 @@ typedef struct lpcmdec_thread_s ...@@ -40,20 +42,17 @@ typedef struct lpcmdec_thread_s
int sync_ptr; /* sync ptr from lpcm magic header */ int sync_ptr; /* sync ptr from lpcm magic header */
adec_config_t * p_config; adec_config_t * p_config;
/*
* Decoder properties
*/
lpcmdec_t lpcm_decoder;
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */ aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
} lpcmdec_thread_t; } lpcmdec_thread_t;
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
vlc_thread_t lpcmdec_CreateThread( adec_config_t * p_config ); vlc_thread_t lpcmdec_CreateThread( adec_config_t * p_config );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment