public abstract class Subframe extends Object
| Modifier and Type | Field and Description |
|---|---|
protected EncodingConfiguration |
ec
EncodingConfiguration used for encoding.
|
protected int |
lastEncodedSize
Store for size of last subframe encoded(in bits).
|
protected StreamConfiguration |
sc
StreamConfiguration used for encoding.
|
| Constructor and Description |
|---|
Subframe(StreamConfiguration sc)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
encodeSamples(int[] samples,
int count,
int start,
int skip,
EncodedElement data,
int offset,
int bitsPerSample)
Encodes samples into the appropriate compressed format, saving the result
in the given “data” EncodedElement list.
|
int |
getEncodedSize()
Returns the total number of valid bits used in the last encoding(i.e, the
number of compressed bits used).
|
boolean |
registerConfiguration(EncodingConfiguration ec)
This method is used to set the encoding configuration.
|
protected StreamConfiguration sc
protected EncodingConfiguration ec
protected int lastEncodedSize
public Subframe(StreamConfiguration sc)
sc - StreamConfiguration to use for encoding.public boolean registerConfiguration(EncodingConfiguration ec)
ec - encoding configuration to use.public abstract int encodeSamples(int[] samples,
int count,
int start,
int skip,
EncodedElement data,
int offset,
int bitsPerSample)
samples - the audio samples to encode. This array may contain
samples for multiple channels, interleaved; only one of these channels is
encoded by a subframe.count - the number of samples to encode.start - the index to start at in the array.skip - the number of indices to skip between successive samples
(for use when channels are interleaved in the given
array).data - the EncodedElement to attach encoded data to. Data in
EncodedElement given is not altered. New data is
attached starting with “data.getNext()”. If “data”
already has a “next” set, it will be lost!offset - bitsPerSample - Number of bits per single-channel sample. This may
differ from the StreamConfiguration's sample size, depending on the
subframe used(i.e, the "side-channel" of a FLAC stream uses one extra bit
compared to the input channels).public int getEncodedSize()
Copyright © 2017. All rights reserved.