Go to the documentation of this file.
57 static const uint8_t bits_per_samples[4] = { 0, 16, 20, 24 };
63 { 0 }, { 0 }, { 0 }, { 0 },
65 uint8_t channel_layout =
header[2] >> 4;
68 ff_dlog(avctx,
"pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
83 switch (
header[2] & 0x0f) {
119 "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %"PRId64
" bit/s\n",
126 int *got_frame_ptr,
AVPacket *avpkt)
128 const uint8_t *
src = avpkt->
data;
129 int buf_size = avpkt->
size;
131 int num_source_channels,
channel, retval;
150 sample_size = (num_source_channels *
152 samples = buf_size / sample_size;
158 dst16 = (int16_t *)
frame->data[0];
167 samples *= num_source_channels;
173 *dst16++ = bytestream2_get_be16u(&gb);
178 *dst32++ = bytestream2_get_be24u(&gb) << 8;
196 *dst16++ = bytestream2_get_be16u(&gb);
205 *dst32++ = bytestream2_get_be24u(&gb) << 8;
215 dst16[0] = bytestream2_get_be16u(&gb);
216 dst16[1] = bytestream2_get_be16u(&gb);
217 dst16[2] = bytestream2_get_be16u(&gb);
218 dst16[4] = bytestream2_get_be16u(&gb);
219 dst16[5] = bytestream2_get_be16u(&gb);
220 dst16[3] = bytestream2_get_be16u(&gb);
225 dst32[0] = bytestream2_get_be24u(&gb) << 8;
226 dst32[1] = bytestream2_get_be24u(&gb) << 8;
227 dst32[2] = bytestream2_get_be24u(&gb) << 8;
228 dst32[4] = bytestream2_get_be24u(&gb) << 8;
229 dst32[5] = bytestream2_get_be24u(&gb) << 8;
230 dst32[3] = bytestream2_get_be24u(&gb) << 8;
239 dst16[0] = bytestream2_get_be16u(&gb);
240 dst16[1] = bytestream2_get_be16u(&gb);
241 dst16[2] = bytestream2_get_be16u(&gb);
242 dst16[5] = bytestream2_get_be16u(&gb);
243 dst16[3] = bytestream2_get_be16u(&gb);
244 dst16[4] = bytestream2_get_be16u(&gb);
245 dst16[6] = bytestream2_get_be16u(&gb);
251 dst32[0] = bytestream2_get_be24u(&gb) << 8;
252 dst32[1] = bytestream2_get_be24u(&gb) << 8;
253 dst32[2] = bytestream2_get_be24u(&gb) << 8;
254 dst32[5] = bytestream2_get_be24u(&gb) << 8;
255 dst32[3] = bytestream2_get_be24u(&gb) << 8;
256 dst32[4] = bytestream2_get_be24u(&gb) << 8;
257 dst32[6] = bytestream2_get_be24u(&gb) << 8;
267 dst16[0] = bytestream2_get_be16u(&gb);
268 dst16[1] = bytestream2_get_be16u(&gb);
269 dst16[2] = bytestream2_get_be16u(&gb);
270 dst16[6] = bytestream2_get_be16u(&gb);
271 dst16[4] = bytestream2_get_be16u(&gb);
272 dst16[5] = bytestream2_get_be16u(&gb);
273 dst16[7] = bytestream2_get_be16u(&gb);
274 dst16[3] = bytestream2_get_be16u(&gb);
279 dst32[0] = bytestream2_get_be24u(&gb) << 8;
280 dst32[1] = bytestream2_get_be24u(&gb) << 8;
281 dst32[2] = bytestream2_get_be24u(&gb) << 8;
282 dst32[6] = bytestream2_get_be24u(&gb) << 8;
283 dst32[4] = bytestream2_get_be24u(&gb) << 8;
284 dst32[5] = bytestream2_get_be24u(&gb) << 8;
285 dst32[7] = bytestream2_get_be24u(&gb) << 8;
286 dst32[3] = bytestream2_get_be24u(&gb) << 8;
298 ff_dlog(avctx,
"pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
304 .
p.
name =
"pcm_bluray",
305 CODEC_LONG_NAME(
"PCM signed 16|20|24-bit big-endian for Blu-ray media"),
#define AV_CH_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_STEREO
int sample_rate
samples per second
const FFCodec ff_pcm_bluray_decoder
#define AV_CH_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_2_2
This structure describes decoded (raw) audio or video data.
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
int nb_channels
Number of channels in this layout.
#define FF_DEBUG_PICT_INFO
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
AVCodec p
The public AVCodec.
AVChannelLayout ch_layout
Audio channel layout.
#define AV_CH_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_SURROUND
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_CHANNEL_LAYOUT_4POINT0
#define FF_CODEC_DECODE_CB(func)
#define AV_CHANNEL_LAYOUT_7POINT1
union AVChannelLayout::@428 u
Details about which channels are present in this layout.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define CODEC_LONG_NAME(str)
int64_t bit_rate
the average bitrate
#define AV_CH_LAYOUT_5POINT1
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_tell(GetByteContext *g)
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
An AVChannelLayout holds information about the channel layout of audio data.
enum AVSampleFormat sample_fmt
audio sample format
static const uint8_t header[24]
#define AV_CH_LAYOUT_5POINT0
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
AVSampleFormat
Audio sample formats.
#define AV_CH_LAYOUT_7POINT1
@ AV_SAMPLE_FMT_S16
signed 16 bits
static int pcm_bluray_parse_header(AVCodecContext *avctx, const uint8_t *header)
Parse the header of a LPCM frame read from a Blu-ray MPEG-TS stream.
const char * name
Name of the codec implementation.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_CH_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_2_1
main external API structure.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
Filter the word “frame” indicates either a video frame or a group of audio samples
#define AV_CHANNEL_LAYOUT_MONO
This structure stores compressed data.
static const uint16_t channel_layouts[7]
#define AV_CH_LAYOUT_4POINT0
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_CHANNEL_LAYOUT_5POINT0
#define AV_CHANNEL_LAYOUT_5POINT1
#define FF_DEBUG_BITSTREAM
@ AV_SAMPLE_FMT_S32
signed 32 bits