Patent Description:
Historically, conversational telephony has been implemented with handsets having only one transducer to output sound only to one of the user's ears. In the last decade, users have started to use their portable handset in conjunction with a headphone to receive the sound over their two ears mainly to listen to music but also, sometimes, to listen to speech. Nevertheless, when a portable handset is used to transmit and receive conversational speech, the content is still monophonic but presented to the user's two ears when a headphone is used.

With the newest 3GPP speech coding standard as described in Reference [<NUM>], the quality of the coded sound, for example speech and/or audio that is transmitted and received through a portable handset has been significantly improved. The next natural step is to transmit stereo information such that the receiver gets as close as possible to a real life audio scene that is captured at the other end of the communication link.

In audio codecs, for example as described in Reference [<NUM>], transmission of stereo information is normally used.

For conversational speech codecs, monophonic signal is the norm. When a stereophonic signal is transmitted, the bit-rate often needs to be doubled since both the left and right channels are coded using a monophonic codec. This works well in most scenarios, but presents the drawbacks of doubling the bit-rate and failing to exploit any potential redundancy between the two channels (left and right channels). Furthermore, to keep the overall bit-rate at a reasonable level, a very low bit-rate for each channel is used, thus affecting the overall sound quality.

A possible alternative is to use the so-called parametric stereo as described in Reference [<NUM>]. Parametric stereo sends information such as inter-aural time difference (ITD) or inter-aural intensity differences (IID), for example. The latter information is sent per frequency band and, at low bit-rate, the bit budget associated to stereo transmission is not sufficiently high to allow these parameters to work efficiently.

Transmitting a panning factor could help to create a basic stereo effect at low bit-rate, but such a technique does nothing to preserve the ambiance and presents inherent limitations. Too fast an adaptation of the panning factor becomes disturbing to the listener while too slow an adaptation of the panning factor does not reflect the real position of the speakers, which makes it difficult to obtain a good quality in case of interfering talkers or when fluctuation of the background noise is important. Currently, encoding conversational stereo speech with a decent quality for all possible audio scenes requires a minimum bit-rate of around <NUM> kb/s for wideband (WB) signals; below that bit-rate, the speech quality starts to suffer. <CIT> and <CIT> describe methods for encoding of multi-channel audio signals, while <CIT> discloses encoding of single-channel audio signals.

With the ever increasing globalization of the workforce and splitting of work teams over the globe, there is a need for improvement of the communications. For example, participants to a teleconference may be in different and distant locations. Some participants could be in their cars, others could be in a large anechoic room or even in their living room. In fact, all participants wish to feel like they have a face-to-face discussion. Implementing stereo speech, more generally stereo sound in portable devices would be a great step in this direction.

The invention provides a stereo sound encoding method for encoding left and right channels of a stereo sound signal according to independent claim <NUM> and a stereo sound encoding system for encoding left and right channels of a stereo sound signal according to independent claim <NUM>. Preferred embodiments of the invention are set forth in the dependent claims.

The present disclosure still further relates to a processor-readable memory comprising non-transitory instructions that, when executed, cause a processor to implement the operations of the above described method.

The foregoing and other objects, advantages and features of the stereo sound encoding method and system for encoding left and right channels of a stereo sound signal will become more apparent upon reading of the following non-restrictive description of illustrative embodiments thereof, given by way of example only with reference to the accompanying drawings.

The present disclosure is concerned with production and transmission, with a low bit-rate and low delay, of a realistic representation of stereo sound content, for example speech and/or audio content, from, in particular but not exclusively, a complex audio scene. A complex audio scene includes situations in which (a) the correlation between the sound signals that are recorded by the microphones is low, (b) there is an important fluctuation of the background noise, and/or (c) an interfering talker is present. Examples of complex audio scenes comprise a large anechoic conference room with an A/B microphones configuration, a small echoic room with binaural microphones, and a small echoic room with a mono/side microphones set-up. All these room configurations could include fluctuating background noise and/or interfering talkers.

Known stereo sound codecs, such as 3GPP AMR-WB+ as described in Reference [<NUM>], are inefficient for coding sound that is not close to the monophonic model, especially at low bit-rate. Certain cases are particularly difficult to encode using existing stereo techniques. Such cases include:.

Adding a fluctuating background noise and/or interfering talkers makes these sound signals even harder to encode at low bit-rate using stereo dedicated techniques, such as parametric stereo. A fall back to encode such signals is to use two monophonic channels, hence doubling the bit-rate and network bandwidth being used.

The latest 3GPP EVS conversational speech standard provides a bit-rate range from <NUM> kb/s to <NUM> kb/s for wideband (WB) operation and <NUM> kb/s to <NUM> kb/s for super wideband (SWB) operation. This means that the three lowest dual mono bit-rates using EVS are <NUM>, <NUM> and <NUM> kb/s for WB operation and <NUM>, <NUM> and <NUM> kb/s for SWB operation. Although speech quality of the deployed 3GPP AMR-WB as described in Reference [<NUM>], improves over its predecessor codec, the quality of the coded speech at <NUM> kb/s in noisy environment is far from being transparent and, therefore, it can be anticipated that the speech quality of dual mono at <NUM> kb/s would also be limited. At such low bit-rates, the bit-rate usage is maximized such that the best possible speech quality is obtained as often as possible. With the stereo sound encoding method and system as disclosed in the following description, the minimum total bit-rate for conversational stereo speech content, even in case of complex audio scenes, should be around <NUM> kb/s for WB and <NUM> kb/s for SWB. At bit-rates that are lower than the bit-rates used in a dual mono approach, the quality and the intelligibility of stereo speech is greatly improved for complex audio scenes.

<FIG> is a schematic block diagram of a stereo sound processing and communication system <NUM> depicting a possible context of implementation of the stereo sound encoding method and system as disclosed in the following description.

The stereo sound processing and communication system <NUM> of <FIG> supports transmission of a stereo sound signal across a communication link <NUM>. The communication link <NUM> may comprise, for example, a wire or an optical fiber link. Alternatively, the communication link <NUM> may comprise at least in part a radio frequency link. The radio frequency link often supports multiple, simultaneous communications requiring shared bandwidth resources such as may be found with cellular telephony. Although not shown, the communication link <NUM> may be replaced by a storage device in a single device implementation of the processing and communication system <NUM> that records and stores the encoded stereo sound signal for later playback.

Still referring to <FIG>, for example a pair of microphones <NUM> and <NUM> produces the left <NUM> and right <NUM> channels of an original analog stereo sound signal detected, for example, in a complex audio scene. As indicated in the foregoing description, the sound signal may comprise, in particular but not exclusively, speech and/or audio. The microphones <NUM> and <NUM> may be arranged according to an A/B, binaural or Mono/side set-up.

The left <NUM> and right <NUM> channels of the original analog sound signal are supplied to an analog-to-digital (A/D) converter <NUM> for converting them into left <NUM> and right <NUM> channels of an original digital stereo sound signal. The left <NUM> and right <NUM> channels of the original digital stereo sound signal may also be recorded and supplied from a storage device (not shown).

A stereo sound encoder <NUM> encodes the left <NUM> and right <NUM> channels of the digital stereo sound signal thereby producing a set of encoding parameters that are multiplexed under the form of a bitstream <NUM> delivered to an optional error-correcting encoder <NUM>. The optional error-correcting encoder <NUM>, when present, adds redundancy to the binary representation of the encoding parameters in the bitstream <NUM> before transmitting the resulting bitstream <NUM> over the communication link <NUM>.

On the receiver side, an optional error-correcting decoder <NUM> utilizes the above mentioned redundant information in the received digital bitstream <NUM> to detect and correct errors that may have occurred during transmission over the communication link <NUM>, producing a bitstream <NUM> with received encoding parameters. A stereo sound decoder <NUM> converts the received encoding parameters in the bitstream <NUM> for creating synthesized left <NUM> and right <NUM> channels of the digital stereo sound signal. The left <NUM> and right <NUM> channels of the digital stereo sound signal reconstructed in the stereo sound decoder <NUM> are converted to synthesized left <NUM> and right <NUM> channels of the analog stereo sound signal in a digital-to-analog (D/A) converter <NUM>.

The synthesized left <NUM> and right <NUM> channels of the analog stereo sound signal are respectively played back in a pair of loudspeaker units <NUM> and <NUM>. Alternatively, the left <NUM> and right <NUM> channels of the digital stereo sound signal from the stereo sound decoder <NUM> may also be supplied to and recorded in a storage device (not shown).

The left <NUM> and right <NUM> channels of the original digital stereo sound signal of <FIG> corresponds to the left L and right R channels of <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG> and <FIG>. Also, the stereo sound encoder <NUM> of <FIG> corresponds to the stereo sound encoding system of <FIG>, <FIG>, <FIG>, <FIG>, <FIG> and <FIG>.

The stereo sound encoding method and system in accordance with the present disclosure are two-fold; first and second models are provided.

<FIG> is a block diagram illustrating concurrently the stereo sound encoding method and system according to the first model, presented as an integrated stereo design based on the EVS core. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

Referring to <FIG>, the stereo sound encoding method according to the first model comprises a time domain down mixing operation <NUM>, a primary channel encoding operation <NUM>, a secondary channel encoding operation <NUM>, and a multiplexing operation <NUM>.

To perform the time-domain down mixing operation <NUM>, a channel mixer <NUM> mixes the two input stereo channels (right channel R and left channel L) to produce a primary channel Y and a secondary channel X.

To carry out the secondary channel encoding operation <NUM>, a secondary channel encoder <NUM> selects and uses a minimum number of bits (minimum bit-rate) to encode the secondary channel X using one of the encoding modes as defined in the following description and produce a corresponding secondary channel encoded bitstream <NUM>. The associated bit budget may change every frame depending on frame content.

To implement the primary channel encoding operation <NUM>, a primary channel encoder <NUM> is used. The secondary channel encoder <NUM> signals to the primary channel encoder <NUM> the number of bits <NUM> used in the current frame to encode the secondary channel X. Any suitable type of encoder can be used as the primary channel encoder <NUM>. As a non-limitative example, the primary channel encoder <NUM> can be a CELP-type encoder. In this illustrative embodiment, the primary channel CELP-type encoder is a modified version of the legacy EVS encoder, where the EVS encoder is modified to present a greater bitrate scalability to allow flexible bit rate allocation between the primary and secondary channels. In this manner, the modified EVS encoder will be able to use all the bits that are not used to encode the secondary channel X for encoding, with a corresponding bit-rate, the primary channel Y and produce a corresponding primary channel encoded bitstream <NUM>.

A multiplexer <NUM> concatenates the primary channel bitstream <NUM> and the secondary channel bitstream <NUM> to form a multiplexed bitstream <NUM>, to complete the multiplexing operation <NUM>.

In the first model, the number of bits and corresponding bit-rate (in the bitstream <NUM>) used to encode the secondary channel X is smaller than the number of bits and corresponding bit-rate (in the bitstream <NUM>) used to encode the primary channel Y. This can be seen as two (<NUM>) variable-bit-rate channels wherein the sum of the bit-rates of the two channels X and Y represents a constant total bit-rate. This approach may have different flavors with more or less emphasis on the primary channel Y. According to a first example, when a maximum emphasis is put on the primary channel Y, the bit budget of the secondary channel X is aggressively forced to a minimum. According to a second example, if less emphasis is put on the primary channel Y, then the bit budget for the secondary channel X may be made more constant, meaning that the average bit-rate of the secondary channel X is slightly higher compared to the first example.

It is reminded that the right R and left L channels of the input digital stereo sound signal are processed by successive frames of a given duration which may corresponds to the duration of the frames used in EVS processing. Each frame comprises a number of samples of the right R and left L channels depending on the given duration of the frame and the sampling rate being used.

<FIG> is a block diagram illustrating concurrently the stereo sound encoding method and system according to the second model, presented as an embedded model. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

Referring to <FIG>, the stereo sound encoding method according to the second model comprises a time domain down mixing operation <NUM>, a primary channel encoding operation <NUM>, a secondary channel encoding operation <NUM>, and a multiplexing operation <NUM>.

To complete the time domain down mixing operation <NUM>, a channel mixer <NUM> mixes the two input right R and left L channels to form a primary channel Y and a secondary channel X.

In the primary channel encoding operation <NUM>, a primary channel encoder <NUM> encodes the primary channel Y to produce a primary channel encoded bitstream <NUM>. Again, any suitable type of encoder can be used as the primary channel encoder <NUM>. As a non-limitative example, the primary channel encoder <NUM> can be a CELP-type encoder. In this illustrative embodiment, the primary channel encoder <NUM> uses a speech coding standard such as the legacy EVS mono encoding mode or the AMR-WB-IO encoding mode, for instance, meaning that the monophonic portion of the bitstream <NUM> would be interoperable with the legacy EVS, the AMR-WB-IO or the legacy AMR-WB decoder when the bit-rate is compatible with such decoder. Depending on the encoding mode being selected, some adjustment of the primary channel Y may be required for processing through the primary channel encoder <NUM>.

In the secondary channel encoding operation <NUM>, a secondary channel encoder <NUM> encodes the secondary channel X at lower bit-rate using one of the encoding modes as defined in the following description. The secondary channel encoder <NUM> produces a secondary channel encoded bitstream <NUM>.

To perform the multiplexing operation <NUM>, a multiplexer <NUM> concatenates the primary channel encoded bitstream <NUM> with the secondary channel encoded bitstream <NUM> to form a multiplexed bitstream <NUM>. This is called an embedded model, because the secondary channel encoded bitstream <NUM> associated to stereo is added on top of an inter-operable bitstream <NUM>. The secondary channel bitstream <NUM> can be stripped-off the multiplexed stereo bitstream <NUM> (concatenated bitstreams <NUM> and <NUM>) at any moment resulting in a bitstream decodable by a legacy codec as described herein above, while a user of a newest version of the codec would still be able to enjoy the complete stereo decoding.

The above described first and second models are in fact close one to another. The main difference between the two models is the possibility to use a dynamic bit allocation between the two channels Y and X in the first model, while bit allocation is more limited in the second model due to interoperability considerations.

Examples of implementation and approaches used to achieve the above described first and second models are given in the following description.

As expressed in the foregoing description, the known stereo models operating at low bit-rate have difficulties with coding speech that is not close to the monophonic model. Traditional approaches perform down mixing in the frequency domain, per frequency band, using for example a correlation per frequency band associated with a Principal Component Analysis (pca) using for example a Karhunen-Loève Transform (klt), to obtain two vectors, as described in references [<NUM>] and [<NUM>]. One of these two vectors incorporates all the highly correlated content while the other vector defines all content that is not much correlated. The best known method to encode speech at low-bit rates uses a time domain codec, such as a CELP (Code-Excited Linear Prediction) codec, in which known frequency-domain solutions are not directly applicable. For that reason, while the idea behind the pca/klt per frequency band is interesting, when the content is speech, the primary channel Y needs to be converted back to time domain and, after such conversion, its content no longer looks like traditional speech, especially in the case of the above described configurations using a speech-specific model such as CELP. This has the effect of reducing the performance of the speech codec. Moreover, at low bit-rate, the input of a speech codec should be as close as possible to the codec's inner model expectations.

Starting with the idea that an input of a low bit-rate speech codec should be as close as possible to the expected speech signal, a first technique has been developed. The first technique is based on an evolution of the traditional pca/klt scheme. While the traditional scheme computes the pca/klt per frequency band, the first technique computes it over the whole frame, directly in the time domain. This works adequately during active speech segments, provided there is no background noise or interfering talker. The pca/klt scheme determines which channel (left L or right R channel) contains the most useful information, this channel being sent to the primary channel encoder. Unfortunately, the pca/klt scheme on a frame basis is not reliable in the presence of background noise or when two or more persons are talking with each other. The principle of the pca/klt scheme involves selection of one input channel (R or L) or the other, often leading to drastic changes in the content of the primary channel to be encoded. At least for the above reasons, the first technique is not sufficiently reliable and, accordingly, a second technique is presented herein for overcoming the deficiencies of the first technique and allow for a smoother transition between the input channels. This second technique will be described hereinafter with reference to <FIG>.

Referring to <FIG>, the operation of time domain down mixing <NUM>/<NUM> (<FIG> and <FIG>) comprises the following sub-operations: an energy analysis sub-operation <NUM>, an energy trend analysis sub-operation <NUM>, an L and R channel normalized correlation analysis sub-operation <NUM>, a long-term (LT) correlation difference calculating sub-operation <NUM>, a long-term correlation difference to factor β conversion and quantization sub-operation <NUM> and a time domain down mixing sub-operation <NUM>. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

Keeping in mind the idea that the input of a low bit-rate sound (such as speech and/or audio) codec should be as homogeneous as possible, the energy analysis sub-operation <NUM> is performed in the channel mixer <NUM>/<NUM> by an energy analyzer <NUM> to first determine, by frame, the rms (Root Mean Square) energy of each input channel R and L using relations (<NUM>): <MAT>
where the subscripts L and R stand for the left and right channels respectively, L(i) stands for sample i of channel L, R(i) stands for sample i of channel R, N corresponds to the number of samples per frame, and t stands for a current frame.

The energy analyzer <NUM> then uses the rms values of relations (<NUM>) to determine long-term rms values rms for each channel using relations (<NUM>): <MAT>
where t represents the current frame and t-<NUM> the previous frame.

To perform the energy trend analysis sub-operation <NUM>, an energy trend analyzer <NUM> of the channel mixer <NUM>/<NUM> uses the long-term rms values rms to determine the trend of the energy in each channel L and R rms_dt using relations (<NUM>): <MAT>.

The trend of the long-term rms values is used as information that shows if the temporal events captured by the microphones are fading-out or if they are changing channels. The long-term rms values and their trend are also used to determine a speed of convergence α of a long-term correlation difference as will be described herein after.

To perform the channels L and R normalized correlation analysis sub-operation <NUM>, an L and R normalized correlation analyzer <NUM> computes a correlation GL|R for each of the left L and right R channels normalized against a monophonic signal version m(i) of the sound, such as speech and/or audio, in the frame t using relations (<NUM>): <MAT>
where N, as already mentioned, corresponds to the number of samples in a frame, and t stands for the current frame. In the current embodiment, all normalized correlations and rms values determined by relations <NUM> to <NUM> are calculated in the time domain, for the whole frame. In another possible configuration, these values can be computed in the frequency domain. For instance, the techniques described herein, which are adapted to sound signals having speech characteristics, can be part of a larger framework which can switch between a frequency domain generic stereo audio coding method and the method described in the present disclosure. In this case computing the normalized correlations and rms values in the frequency domain may present some advantage in terms of complexity or code re-use.

To compute the long-term (LT) correlation difference in sub-operation <NUM>, a calculator <NUM> computes for each channel L and R in the current frame smoothed normalized correlations using relations (<NUM>): <MAT>
where α is the above mentioned speed of convergence. Finally, the calculator <NUM> determines the long-term (LT) correlation difference GLR using relation (<NUM>): <MAT>.

In one example embodiment, the speed of convergence α may have a value of <NUM> or <NUM> depending on the long-term energies computed in relations (<NUM>) and the trend of the long-term energies as computed in relations (<NUM>). For instance, the speed of convergence α may have a value of <NUM> when the long-term energies of the left L and right R channels evolve in a same direction, a difference between the long-term correlation difference GLR at frame t and the long-term correlation difference GLR at frame t-<NUM> is low (below <NUM> for this example embodiment), and at least one of the long-term rms values of the left L and right R channels is above a certain threshold (<NUM> in this example embodiment). Such cases mean that both channels L and R are evolving smoothly, there is no fast change in energy from one channel to the other, and at least one channel contains a meaningful level of energy. Otherwise, when the long-term energies of the right R and left L channels evolve in different directions, when the difference between the long-term correlation differences is high, or when the two right R and left L channels have low energies, then α will be set to <NUM> to increase a speed of adaptation of the long-term correlation difference GLR.

To carry out the conversion and quantization sub-operation <NUM>, once the long-term correlation difference GLR has been properly estimated in calculator <NUM>, the converter and quantizer <NUM> converts this difference into a factor β that is quantized, and supplied to (a) the primary channel encoder <NUM> (<FIG>), (b) the secondary channel encoder <NUM>/<NUM> (<FIG> and <FIG>), and (c) the multiplexer <NUM>/<NUM> (<FIG> and <FIG>) for transmission to a decoder within the multiplexed bitstream <NUM>/<NUM> through a communication link such as <NUM> of <FIG>.

The factor β represents two aspects of the stereo input combined into one parameter. First, the factor β represents a proportion or contribution of each of the right R and left L channels that are combined together to create the primary channel Y and, second, it can also represent an energy scaling factor to apply to the primary channel Y to obtain a primary channel that is close in the energy domain to what a monophonic signal version of the sound would look like. Thus, in the case of an embedded structure, it allows the primary channel Y to be decoded alone without the need to receive the secondary bitstream <NUM> carrying the stereo parameters. This energy parameter can also be used to rescale the energy of the secondary channel X before encoding thereof, such that the global energy of the secondary channel X is closer to the optimal energy range of the secondary channel encoder. As shown on <FIG>, the energy information intrinsically present in the factor β may also be used to improve the bit allocation between the primary and the secondary channels.

The quantized factor β may be transmitted to the decoder using an index. Since the factor β can represent both (a) respective contributions of the left and right channels to the primary channel and (b) an energy scaling factor to apply to the primary channel to obtain a monophonic signal version of the sound or a correlation/energy information that helps to allocate more efficiently the bits between the primary channel Y and the secondary channel X, the index transmitted to the decoder conveys two distinct information elements with a same number of bits.

To obtain a mapping between the long-term correlation difference GLR(t) and the factor β, in this example embodiment, the converter and quantizer <NUM> first limits the long-term correlation difference GLR(t) between -<NUM> to <NUM> and then linearizes this long-term correlation difference between <NUM> and <NUM> to get a temporary linearized long-term correlation difference <MAT> as shown by relation (<NUM>): <MAT>.

In an alternative implementation, it may be decided to use only a part of the space filled with the linearized long-term correlation difference <MAT>, by further limiting its values between, for example, <NUM> and <NUM>. This additional limitation would have the effect to reduce the stereo image localization, but to also save some quantization bits. Depending on the design choice, this option can be considered.

After the linearization, the converter and quantizer <NUM> performs a mapping of the linearized long-term correlation difference <MAT> into the "cosine" domain using relation (<NUM>): <MAT>.

To perform the time domain down mixing sub-operation <NUM>, a time domain down mixer <NUM> produces the primary channel Y and the secondary channel X as a mixture of the right R and left L channels using relations (<NUM>) and (<NUM>): <MAT> <MAT>
where i = <NUM>,. ,N-<NUM> is the sample index in the frame and t is the frame index.

<FIG> is a block diagram showing concurrently other embodiments of sub-operations of the time domain down mixing operation <NUM>/<NUM> of the stereo sound encoding method of <FIG> and <FIG>, and modules of the channel mixer <NUM>/<NUM> of the stereo sound encoding system of <FIG> and <FIG>, using a pre-adaptation factor to enhance stereo image stability. In an alternative implementation as represented in <FIG>, the time domain down mixing operation <NUM>/<NUM> comprises the following sub-operations: an energy analysis sub-operation <NUM>, an energy trend analysis sub-operation <NUM>, an L and R channel normalized correlation analysis sub-operation <NUM>, a pre-adaptation factor computation sub-operation <NUM>, an operation <NUM> of applying the pre-adaptation factor to normalized correlations, a long-term (LT) correlation difference computation sub-operation <NUM>, a gain to factor β conversion and quantization sub-operation <NUM>, and a time domain down mixing sub-operation <NUM>. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

The sub-operations <NUM>, <NUM> and <NUM> are respectively performed by an energy analyzer <NUM>, an energy trend analyzer <NUM> and an L and R normalized correlation analyzer <NUM>, substantially in the same manner as explained in the foregoing description in relation to sub-operations <NUM>, <NUM> and <NUM>, and analyzers <NUM>, <NUM> and <NUM> of <FIG>.

To perform sub-operation <NUM>, the channel mixer <NUM>/<NUM> comprises a calculator <NUM> for applying the pre-adaptation factor ar directly to the correlations GL|R) (GL(t) and GR(t)) from relations (<NUM>) such that their evolution is smoothed depending on the energy and the characteristics of both channels. If the energy of the signal is low or if it has some unvoiced characteristics, then the evolution of the correlation gain can be slower.

To carry out the pre-adaptation factor computation sub-operation <NUM>, the channel mixer <NUM>/<NUM> comprises a pre-adaptation factor calculator <NUM>, supplied with (a) the long term left and right channel energy values of relations (<NUM>) from the energy analyzer <NUM>, (b) frame classification of previous frames and (c) voice activity information of the previous frames. The pre-adaptation factor calculator <NUM> computes the pre-adaptation factor ar, which may be linearized between <NUM> and <NUM> depending on the minimum long term rms values rmsL|R of the left and right channels from analyzer <NUM>, using relation (6a): <MAT>.

In an embodiment, coefficient Ma may have the value of <NUM> and coefficient Ba the value of <NUM>. In a variant, the pre-adaptation factor ar may be forced to <NUM>, for example, if a previous classification of the two channels R and L is indicative of unvoiced characteristics and of an active signal. A voice activity detection (VAD) hangover flag may also be used to determine that a previous part of the content of a frame was an active segment.

The operation <NUM> of applying the pre-adaptation factor ar to the normalized correlations GL|R (GL(t) and GR(t) from relations (<NUM>)) of the left L and right R channels is distinct from the operation <NUM> of <FIG>. Instead of calculating long term (LT) smoothed normalized correlations by applying to the normalized correlations GL|R (GL(t) and GR(t)) a factor (<NUM>-α), α being the above defined speed of convergence (Relations (<NUM>)), the calculator <NUM> applies the pre-adaptation factor ar directly to the normalized correlations GL|R (GL(t) and GR(t)) of the left L and right R channels using relation (11b): <MAT>.

The calculator <NUM> outputs adapted correlation gains τL|R that are provided to a calculator of long-term (LT) correlation differences <NUM>. The operation of time domain down mixing <NUM>/<NUM> (<FIG> and <FIG>) comprises, in the implementation of <FIG>, a long-term (LT) correlation difference calculating sub-operation <NUM>, a long-term correlation difference to factor β conversion and quantization sub-operation <NUM> and a time domain down mixing sub-operation <NUM> similar to the sub-operations <NUM>, <NUM> and <NUM>, respectively, of <FIG>.

The operation of time domain down mixing <NUM>/<NUM> (<FIG> and <FIG>) comprises, in the implementation of <FIG>, a long-term (LT) correlation difference calculating sub-operation <NUM>, a long-term correlation difference to factor β conversion and quantization sub-operation <NUM> and a time domain down mixing sub-operation <NUM> similar to the sub-operations <NUM>, <NUM> and <NUM>, respectively, of <FIG>.

The sub-operations <NUM>, <NUM> and <NUM> are respectively performed by a calculator <NUM>, a converter and quantizer <NUM> and time domain down mixer <NUM>, substantially in the same manner as explained in the foregoing description in relation to sub-operations <NUM>, <NUM> and <NUM>, and the calculator <NUM>, converter and quantizer <NUM> and time domain down mixer <NUM>.

<FIG> shows how the linearized long-term correlation difference <MAT> is mapped to the factor β and the energy scaling. It can be observed that for a linearized long-term correlation difference <MAT> of <NUM>, meaning that the right R and left L channel energies/correlations are almost the same, the factor β is equal to <NUM> and an energy normalization (rescaling) factor ε is <NUM>. In this situation, the content of the primary channel Y is basically a mono mixture and the secondary channel X forms a side channel. Calculation of the energy normalization (rescaling) factor ε is described hereinbelow. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

On the other hand, if the linearized long-term correlation difference <MAT> is equal to <NUM>, meaning that most of the energy is in the left channel L, then the factor β is <NUM> and the energy normalization (rescaling) factor is <NUM>, indicating that the primary channel Y basically contains the left channel L in an integrated design implementation or a downscaled representation of the left channel L in an embedded design implementation. In this case, the secondary channel X contains the right channel R. In the example embodiments, the converter and quantizer <NUM> or <NUM> quantizes the factor β using <NUM> possible quantization entries. The quantized version of the factor β is represented using a <NUM> bits index and, as described hereinabove, is supplied to the multiplexer for integration into the multiplexed bitstream <NUM>/<NUM>, and transmitted to the decoder through the communication link.

In an embodiment, the factor β may also be used as an indicator for both the primary channel encoder <NUM>/<NUM> and the secondary channel encoder <NUM>/<NUM> to determine the bit-rate allocation. For example, if the β factor is close to <NUM>, meaning that the two (<NUM>) input channel energies/correlation to the mono are close to each other, more bits would be allocated to the secondary channel X and less bits to the primary channel Y, except if the content of both channels is pretty close, then the content of the secondary channel will be really low energy and likely be considered as inactive, thus allowing very few bits to code it. On the other hand, if the factor β is closer to <NUM> or <NUM>, then the bit-rate allocation will favor the primary channel Y.

<FIG> shows the difference between using the above mentioned pca/klt scheme over the entire frame (two top curves of <FIG>) versus using the "cosine" function as developed in relation (<NUM>) to compute the factor β (bottom curve of <FIG>). By nature the pca/klt scheme tends to search for a minimum or a maximum. This works well in case of active speech as shown by the middle curve of <FIG>, but this does not work really well for speech with background noise as it tends to continuously switch from <NUM> to <NUM> as shown by the middle curve of <FIG>. Too frequent switching to extremities, <NUM> and <NUM>, causes lots of artefacts when coding at low bit-rate. A potential solution would have been to smooth out the decisions of the pca/klt scheme, but this would have negatively impacted the detection of speech bursts and their correct locations while the "cosine" function of relation (<NUM>) is more efficient in this respect. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

<FIG> shows the primary channel Y, the secondary channel X and the spectrums of these primary Y and secondary X channels resulting from applying time domain down mixing to a stereo sample that has been recorded in a small echoic room using a binaural microphones setup with office noise in background. After the time domain down mixing operation, it can be seen that both channels still have similar spectrum shapes and the secondary channel X still has a speech like temporal content, thus permitting to use a speech based model to encode the secondary channel X. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

The time domain down mixing presented in the foregoing description may show some issues in the special case of right R and left L channels that are inverted in phase. Summing the right R and left L channels to obtain a monophonic signal would result in the right R and left L channels cancelling each other. To solve this possible issue, in an embodiment, channel mixer <NUM>/<NUM> compares the energy of the monophonic signal to the energy of both the right R and left L channels. The energy of the monophonic signal should be at least greater than the energy of one of the right R and left L channels. Otherwise, in this embodiment, the time domain down mixing model enters the inverted phase special case. In the presence of this special case, the factor β is forced to <NUM> and the secondary channel X is forcedly encoded using generic or unvoiced mode, thus preventing the inactive coding mode and ensuring proper encoding of the secondary channel X. This special case, where no energy rescaling is applied, is signaled to the decoder by using the last bits combination (index value) available for the transmission of the factor β (Basically since β is quantized using <NUM> bits and <NUM> entries (quantization levels) are used for quantization as described hereinabove, the <NUM>th possible bit combination (entry or index value) is used for signaling this special case).

In an alternative implementation, more emphasis may be put on the detection of signals that are suboptimal for the down mixing and coding techniques described hereinabove, such as in cases of out-of-phase or near out-of-phase signals. Once these signals are detected, the underlying coding techniques may be adapted if needed.

Typically, for time domain down mixing as described herein, when the left L and right R channels of an input stereo signal are out-of-phase, some cancellation may happen during the down mixing process, which could lead to a suboptimal quality. In the above examples, the detection of these signals is simple and the coding strategy comprises encoding both channels separately. But sometimes, with special signals, such as signals that are out-of-phase, it may be more efficient to still perform a down mixing similar to mono/side (β = <NUM>), where a greater emphasis is put on the side channel. Given that some special treatment of these signals may be beneficial, the detection of such signals needs to be performed carefully. Furthermore, transition from the normal time domain down mixing model as described in the foregoing description and the time domain down mixing model that is dealing with these special signals may be triggered in very low energy region or in regions where the pitch of both channels is not stable, such that the switching between the two models has a minimal subjective effect.

Temporal delay correction (TDC) (see temporal delay corrector <NUM> in <FIG> and <FIG>) between the L and R channels, or a technique similar to what is described in reference [<NUM>], may be performed before entering into the down-mixing module <NUM>/<NUM>, <NUM>/<NUM>. In such an embodiment, the factor β may end-up having a different meaning from that which has been described hereinabove. For this type of implementation, at the condition that the temporal delay correction operates as expected, the factor β may become close to <NUM>, meaning that the configuration of the time domain down mixing is close to a mono/side configuration. With proper operation of the temporal delay correction (TDC), the side may contain a signal including a smaller amount of important information. In that case, the bitrate of the secondary channel X may be minimum when the factor β is close to <NUM>. On the other hand, if the factor β is close to <NUM> or <NUM>, this means that the temporal delay correction (TDC) may not properly overcome the delay miss-alignment situation and the content of the secondary channel X is likely to be more complex, thus needing a higher bitrate. For both types of implementation, the factor β and by association the energy normalization (rescaling) factor ε, may be used to improve the bit allocation between the primary channel Y and the secondary channel X.

<FIG> is a block diagram showing concurrently operations of an out-of-phase signal detection and modules of an out-of-phase signal detector <NUM> forming part of the down-mixing operation <NUM>/<NUM> and channel mixer <NUM>/<NUM>. The operations of the out-of-phase signal detection includes, as shown in <FIG>, an out-of-phase signal detection operation <NUM>, a switching position detection operation <NUM>, and channel mixer selection operation <NUM>, to choose between the time-domain down mixing operation <NUM>/<NUM> and an out-of-phase specific time domain down mixing operation <NUM>. These operations are respectively performed by an out-of-phase signal detector <NUM>, a switching position detector <NUM>, a channel mixer selector <NUM>, the previously described time domain down channel mixer <NUM>/<NUM>, and an out-of-phase specific time domain down channel mixer <NUM>. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

The out-of-phase signal detection <NUM> is based on an open loop correlation between the primary and secondary channels in previous frames. To this end, the detector <NUM> computes in the previous frames an energy difference Sm(t) between a side signal s(i) and a mono signal m(i) using relations (12a) and (12b): <MAT> <MAT>.

Then, the detector <NUM> computes the long term side to mono energy difference Sm(t) using relation (12c): <MAT>
where t indicates the current frame, t-<NUM> the previous frame, and where inactive content may be derived from the Voice Activity Detector (VAD) hangover flag or from a VAD hangover counter.

In addition to the long term side to mono energy difference Sm(t), the last pitch open loop maximum correlation CF|L of each channel Y and X, as defined in clause <NUM>. <NUM> of Reference [<NUM>], is also taken into account to decide when the current model is considered as sub-optimal. CP(t-<NUM>) represents the pitch open loop maximum correlation of the primary channel Y in a previous frame and CS(t-<NUM>), the open pitch loop maximum correlation of the secondary channel X in the previous frame. A sub-optimality flag Fsub is calculated by the switching position detector <NUM> according to the following criteria:.

If the long term side to mono energy difference Sm(t) is above a certain threshold, for example when Sm(t) > <NUM>, if both the pitch open loop maximum correlations CP(t-<NUM>) and CS(t-<NUM>) are between <NUM> and <NUM>, meaning the signals have a good correlation, but are not as correlated as a voiced signal would be, the sub-optimality flag Fsub is set to <NUM>, indicating an out-of-phase condition between the left L and right R channels.

Otherwise, the sub-optimality flag Fsub is set to <NUM>, indicating no out-of-phase condition between the left L and right R channels.

To add some stability in the sub-optimality flag decision, the switching position detector <NUM> implements a criterion regarding the pitch contour of each channel Y and X. The switching position detector <NUM> determines that the channel mixer <NUM> will be used to code the sub-optimal signals when, in the example embodiment, at least three (<NUM>) consecutive instances of the sub-optimality flag Fsub are set to <NUM> and the pitch stability of the last frame of one of the primary channel, ppc(t-<NUM>), or of the secondary channel, psc(t-<NUM>), is greater than <NUM>. The pitch stability consists in the sum of the absolute differences of the three open loop pitches p<NUM>|<NUM>|<NUM> as defined in <NUM>. <NUM> of Reference [<NUM>], computed by the switching position detector <NUM> using relation (12d): <MAT>.

The switching position detector <NUM> provides the decision to the channel mixer selector <NUM> that, in turn, selects the channel mixer <NUM>/<NUM> or the channel mixer <NUM> accordingly. The channel mixer selector <NUM> implements a hysteresis such that, when the channel mixer <NUM> is selected, this decision holds until the following conditions are met: a number of consecutive frames, for example <NUM> frames, are considered as being optimal, the pitch stability of the last frame of one of the primary ppc(t-<NUM>) or the secondary channel psc(t-<NUM>) is greater than a predetermined number, for example <NUM>, and the long term side to mono energy difference Sm(t) is below or equal to <NUM>.

<FIG> is a block diagram illustrating concurrently the stereo sound encoding method and system, with a possible implementation of optimization of the encoding of both the primary Y and secondary X channels of the stereo sound signal, such as speech or audio.

Referring to <FIG>, the stereo sound encoding method comprises a low complexity pre-processing operation <NUM> implemented by a low complexity pre-processor <NUM>, a signal classification operation <NUM> implemented by a signal classifier <NUM>, a decision operation <NUM> implemented by a decision module <NUM>, a four (<NUM>) subframes model generic only encoding operation <NUM> implemented by a four (<NUM>) subframes model generic only encoding module <NUM>, a two (<NUM>) subframes model encoding operation <NUM> implemented by a two (<NUM>) subframes model encoding module <NUM>, and an LP filter coherence analysis operation <NUM> implemented by an LP filter coherence analyzer <NUM>.

After time-domain down mixing <NUM> has been performed by the channel mixer <NUM>, in the case of the embedded model, the primary channel Y is encoded (primary channel encoding operation <NUM>) (a) using as the primary channel encoder <NUM> a legacy encoder such as the legacy EVS encoder or any other suitable legacy sound encoder (It should be kept in mind that, as mentioned in the foregoing description, any suitable type of encoder can be used as the primary channel encoder <NUM>). In the case of an integrated structure, a dedicated speech codec is used as primary channel encoder <NUM>. The dedicated speech encoder <NUM> may be a variable bit-rate (VBR) based encoder, for example a modified version of the legacy EVS encoder, which has been modified to have a greater bitrate scalability that permits the handling of a variable bitrate on a per frame level (Again it should be kept in mind that, as mentioned in the foregoing description, any suitable type of encoder can be used as the primary channel encoder <NUM>). This allows that the minimum amount of bits used for encoding the secondary channel X to vary in each frame and be adapted to the characteristics of the sound signal to be encoded. At the end, the signature of the secondary channel X will be as homogeneous as possible.

Encoding of the secondary channel X, i.e. the lower energy/correlation to mono input, is optimized to use a minimal bit-rate, in particular but not exclusively for speech like content. For that purpose, the secondary channel encoding can take advantage of parameters that are already encoded in the primary channel Y, such as the LP filter coefficients (LPC) and/or pitch lag <NUM>. Specifically, it will be decided, as described hereinafter, if the parameters calculated during the primary channel encoding are sufficiently close to corresponding parameters calculated during the secondary channel encoding to be re-used during the secondary channel encoding.

First, the low complexity pre-processing operation <NUM> is applied to the secondary channel X using the low complexity pre-processor <NUM>, wherein a LP filter, a voice activity detection (VAD) and an open loop pitch are computed in response to the secondary channel X. The latter calculations may be implemented, for example, by those performed in the EVS legacy encoder and described respectively in clauses <NUM>. <NUM>, <NUM>. <NUM> and <NUM>. <NUM> of Reference [<NUM>]. Since, as mentioned in the foregoing description, any suitable type of encoder may be used as the primary channel encoder <NUM>/<NUM>, the above calculations may be implemented by those performed in such a primary channel encoder.

Then, the characteristics of the secondary channel X signal are analyzed by the signal classifier <NUM> to classify the secondary channel X as unvoiced, generic or inactive using techniques similar to those of the EVS signal classification function, clause <NUM>. <NUM> of the same Reference [<NUM>]. These operations are known to those of ordinary skill in the art and can been extracted from Standard 3GPP TS <NUM>, v. <NUM> for simplicity, but alternative implementations can be used as well.

An important part of bit-rate consumption resides in the quantization of the LP filter coefficients (LPC). At low bit-rate, full quantization of the LP filter coefficients can take up to nearly <NUM>% of the bit budget. Given that the secondary channel X is often close in frequency content to the primary channel Y, but with lowest energy level, it is worth verifying if it would be possible to reuse the LP filter coefficients of the primary channel Y. To do so, as shown in <FIG>, an LP filter coherence analysis operation <NUM> implemented by an LP filter coherence analyzer <NUM> has been developed, in which few parameters are computed and compared to validate the possibility to re-use or not the LP filter coefficients (LPC) <NUM> of the primary channel Y.

<FIG> is a block diagram illustrating the LP filter coherence analysis operation <NUM> and the corresponding LP filter coherence analyzer <NUM> of the stereo sound encoding method and system of <FIG>. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

The LP filter coherence analysis operation <NUM> and corresponding LP filter coherence analyzer <NUM> of the stereo sound encoding method and system of <FIG> comprise, as illustrated in <FIG>, a primary channel LP (Linear Prediction) filter analysis sub-operation <NUM> implemented by an LP filter analyzer <NUM>, a weighing sub-operation <NUM> implemented by a weighting filter <NUM>, a secondary channel LP filter analysis sub-operation <NUM> implemented by an LP filter analyzer <NUM>, a weighing sub-operation <NUM> implemented by a weighting filter <NUM>, an Euclidean distance analysis sub-operation <NUM> implemented by an Euclidean distance analyzer <NUM>, a residual filtering sub-operation <NUM> implemented by a residual filter <NUM>, a residual energy calculation sub-operation <NUM> implemented by a calculator <NUM> of energy of residual, a subtraction sub-operation <NUM> implemented by a subtractor <NUM>, a sound (such as speech and/or audio) energy calculation sub-operation <NUM> implemented by a calculator <NUM> of energy, a secondary channel residual filtering operation <NUM> implemented by a secondary channel residual filter <NUM>, a residual energy calculation sub-operation <NUM> implemented by a calculator of energy of residual <NUM>, a subtraction sub-operation <NUM> implemented by a subtractor <NUM>, a gain ratio calculation sub-operation <NUM> implemented by a calculator of gain ratio, a comparison sub-operation <NUM> implemented by a comparator <NUM>, a comparison sub-operation <NUM> implemented by a comparator <NUM>, a secondary channel LP filter use decision sub-operation <NUM> implemented by a decision module <NUM>, and a primary channel LP filter re-use decision sub-operation <NUM> implemented by a decision module <NUM>.

Referring to <FIG>, the LP filter analyzer <NUM> performs an LP filter analysis on the primary channel Y while the LP filter analyzer <NUM> performs an LP filter analysis on the secondary channel X. The LP filter analysis performed on each of the primary Y and secondary X channels is similar to the analysis described in clause <NUM>. <NUM> of Reference [<NUM>].

Then, the LP filter coefficients Ay from the LP filter analyzer <NUM> are supplied to the residual filter <NUM> for a first residual filtering, rY, of the secondary channel X. In the same manner, the optimal LP filter coefficients Ax from the LP filter analyzer <NUM> are supplied to the residual filter <NUM> for a second residual filtering, rX, of the secondary channel X. The residual filtering with either filter coefficients, AY or AX, is performed as using relation (<NUM>): <MAT>
where, in this example, sx represents the secondary channel, the LP filter order is <NUM>, and N is the number of samples in the frame (frame size) which is usually <NUM> corresponding a <NUM> frame duration at a sampling rate of <NUM>.

The calculator <NUM> computes the energy Ex of the sound signal in the secondary channel X using relation (<NUM>): <MAT>
and the calculator <NUM> computes the energy Ery of the residual from the residual filter <NUM> using relation (<NUM>): <MAT>.

The subtractor <NUM> subtracts the residual energy from calculator <NUM> from the sound energy from calculator <NUM> to produce a prediction gain GY.

In the same manner, the calculator <NUM> computes the energy Erx of the residual from the residual filter <NUM> using relation (<NUM>): <MAT>
and the subtractor <NUM> subtracts this residual energy from the sound energy from calculator <NUM> to produce a prediction gain GX.

The calculator <NUM> computes the gain ratio GY/GX. The comparator <NUM> compares the gain ratio GY/GX to a threshold τ, which is <NUM> in the example embodiment. If the ratio GY/GX is smaller than the threshold τ, the result of the comparison is transmitted to decision module <NUM> which forces use of the secondary channel LP filter coefficients for encoding the secondary channel X.

The Euclidean distance analyzer <NUM> performs an LP filter similarity measure, such as the Euclidean distance between the line spectral pairs lspY computed by the LP filter analyzer <NUM> in response to the primary channel Y and the line spectral pairs lspX computed by the LP filter analyzer <NUM> in response to the secondary channel X. As known to those of ordinary skill in the art, the line spectral pairs lspY and lspX represent the LP filter coefficients in a quantization domain. The analyzer <NUM> uses relation (<NUM>) to determine the Euclidean distance dist: <MAT>
where M represents the filter order, and lspY and lspX represent respectively the line spectral pairs computed for the primary Y and the secondary X channels.

Before computing the Euclidean distance in analyzer <NUM>, it is possible to weight both sets of line spectral pairs lspY and lspX through respective weighting factors such that more or less emphasis is put on certain portions of the spectrum. Other LP filter representations can be also used to compute the LP filter similarity measure.

Once the Euclidian distance dist is known, it is compared to a threshold σ in comparator <NUM>. In the example embodiment, the threshold σ has a value of <NUM>. When the comparator <NUM> determines that the ratio GY/GX is equal to or larger than the threshold τ and the comparator <NUM> determines that the Euclidian distance dist is equal to or larger than the threshold σ, the result of the comparisons is transmitted to decision module <NUM> which forces use of the secondary channel LP filter coefficients for encoding the secondary channel X. When the comparator <NUM> determines that the ratio GY/GX is equal to or larger than the threshold τ and the comparator <NUM> determines that the Euclidian distance dist is smaller than the threshold σ, the result of these comparisons is transmitted to decision module <NUM> which forces re-use of the primary channel LP filter coefficients for encoding the secondary channel X. In the latter case, the primary channel LP filter coefficients are re-used as part of the secondary channel encoding.

Some additional tests can be conducted to limit re-usage of the primary channel LP filter coefficients for encoding the secondary channel X in particular cases, for example in the case of unvoiced coding mode, where the signal is sufficiently easy to encode that there is still bit-rate available to encode the LP filter coefficients as well. It is also possible to force re-use of the primary channel LP filter coefficients when a very low residual gain is already obtained with the secondary channel LP filter coefficients or when the secondary channel X has a very low energy level. Finally, the variables τ, σ, the residual gain level or the very low energy level at which the reuse of the LP filter coefficients can be forced can all be adapted as a function of the bit budget available and/or as a function of the content type. For example, if the content of the secondary channel is considered as inactive, then even if the energy is high, it may be decided to reuse the primary channel LP filter coefficients.

Since the primary Y and secondary X channels may be a mix of both the right R and left L input channels, this implies that, even if the energy content of the secondary channel X is low compared to the energy content of the primary channel Y, a coding artefact may be perceived once the up-mix of the channels is performed. To limit such possible artefact, the coding signature of the secondary channel X is kept as constant as possible to limit any unintended energy variation. As shown in <FIG>, the content of the secondary channel X has similar characteristics to the content of the primary channel Y and for that reason a very low bit-rate speech like coding model has been developed.

Referring back to <FIG>, the LP filter coherence analyzer <NUM> sends to the decision module <NUM> the decision to re-use the primary channel LP filter coefficients from decision module <NUM> or the decision to use the secondary channel LP filter coefficients from decision module <NUM>. Decision module <NUM> then decides not to quantize the secondary channel LP filter coefficients when the primary channel LP filter coefficients are re-used and to quantize the secondary channel LP filter coefficients when the decision is to use the secondary channel LP filter coefficients. In the latter case, the quantized secondary channel LP filter coefficients are sent to the multiplexer <NUM>/<NUM> for inclusion in the multiplexed bitstream <NUM>/<NUM>.

In the four (<NUM>) subframes model generic only encoding operation <NUM> and the corresponding four (<NUM>) subframes model generic only encoding module <NUM>, to keep the bit-rate as low as possible, an ACELP search as described in clause <NUM>. <NUM> of Reference [<NUM>] is used only when the LP filter coefficients from the primary channel Y can be re-used, when the secondary channel X is classified as generic by signal classifier <NUM>, and when the energy of the input right R and left L channels is close to the center, meaning that the energies of both the right R and left L channels are close to each other. The coding parameters found during the ACELP search in the four (<NUM>) subframes model generic only encoding module <NUM> are then used to construct the secondary channel bitstream <NUM>/<NUM> and sent to the multiplexer <NUM>/<NUM> for inclusion in the multiplexed bitstream <NUM>/<NUM>.

Otherwise, in the two (<NUM>) subframes model encoding operation <NUM> and the corresponding two (<NUM>) subframes model encoding module <NUM>, a half-band model is used to encode the secondary channel X with generic content when the LP filter coefficients from the primary channel Y cannot be re-used. For the inactive and unvoiced content, only the spectrum shape is coded.

In encoding module <NUM>, inactive content encoding comprises (a) frequency domain spectral band gain coding plus noise filling and (b) coding of the secondary channel LP filter coefficients when needed as described respectively in (a) clauses <NUM>. <NUM> and <NUM>. <NUM> and (b) clause <NUM>. <NUM> of Reference [<NUM>]. Inactive content can be encoded at a bit-rate as low as <NUM> kb/s.

In encoding module <NUM>, the secondary channel X unvoiced encoding is similar to the secondary channel X inactive encoding, with the exception that the unvoiced encoding uses an additional number of bits for the quantization of the secondary channel LP filter coefficients which are encoded for unvoiced secondary channel.

The half-band generic coding model is constructed similarly to ACELP as described in clause <NUM>. <NUM> of Reference [<NUM>], but it is used with only two (<NUM>) sub-frames by frame. Thus, to do so, the residual as described in clause <NUM>. <NUM> of Reference [<NUM>], the memory of the adaptive codebook as described in clause <NUM>. <NUM> of Reference [<NUM>] and the input secondary channel are first down-sampled by a factor <NUM>. The LP filter coefficients are also modified to represent the down-sampled domain instead of the <NUM> sampling frequency using a technique as described in clause <NUM>. <NUM> of Reference [<NUM>].

After the ACELP search, a bandwidth extension is performed in the frequency domain of the excitation. The bandwidth extension first replicates the lower spectral band energies into the higher band. To replicate the spectral band energies, the energy of the first nine (<NUM>) spectral bands, Gbd(i), are found as described in clause <NUM>. <NUM> of Reference [<NUM>] and the last bands are filled as shown in relation (<NUM>): <MAT>.

Then, the high frequency content of the excitation vector represented in the frequency domain fd(k) as described in clause <NUM>. <NUM> of Reference [<NUM>] is populated using the lower band frequency content using relation (<NUM>): <MAT>.

The coding parameters found during the low-rate inactive encoding, the low rate unvoiced encoding or the half-band generic encoding performed in the two (<NUM>) subframes model encoding module <NUM> are then used to construct the secondary channel bitstream <NUM>/<NUM> sent to the multiplexer <NUM>/<NUM> for inclusion in the multiplexed bitstream <NUM>/<NUM>.

Encoding of the secondary channel X may be achieved differently, with the same goal of using a minimal number of bits while achieving the best possible quality and while keeping a constant signature. Encoding of the secondary channel X may be driven in part by the available bit budget, independently from the potential re-use of the LP filter coefficients and the pitch information. Also, the two (<NUM>) subframes model encoding (operation <NUM>) may either be half band or full band. In this alternative implementation of the secondary channel low bit-rate encoding, the LP filter coefficients and/or the pitch information of the primary channel can be re-used and the two (<NUM>) subframes model encoding can be chosen based on the bit budget available for encoding the secondary channel X. Also, the <NUM> subframes model encoding presented below has been created by doubling the subframe length instead of down-sampling/up-sampling its input/output parameters.

<FIG> is a block diagram illustrating concurrently an alternative stereo sound encoding method and an alternative stereo sound encoding system. The stereo sound encoding method and system of <FIG> include several of the operations and modules of the method and system of <FIG>, identified using the same reference numerals and whose description is not repeated herein for brevity. In addition, the stereo sound encoding method of <FIG> comprises a pre-processing operation <NUM> applied to the primary channel Y before its encoding at operation <NUM>/<NUM>, a pitch coherence analysis operation <NUM>, an unvoiced/inactive decision operation <NUM>, an unvoiced/inactive coding decision operation <NUM>, and a <NUM>/<NUM> subframes model decision operation <NUM>. <FIG> and its description illustrates and describes an implementation of the claimed invention.

The sub-operations <NUM>, <NUM>, <NUM>, <NUM>, <NUM> and <NUM> are respectively performed by a pre-processor <NUM> similar to low complexity pre-processor <NUM>, a pitch coherence analyzer <NUM>, a bit allocation estimator <NUM>, a unvoiced/inactive decision module <NUM>, an unvoiced/inactive encoding decision module <NUM> and a <NUM>/<NUM> subframes model decision module <NUM>.

To perform the pitch coherence analysis operation <NUM>, the pitch coherence analyzer <NUM> is supplied by the pre-processors <NUM> and <NUM> with open loop pitches of both the primary Y and secondary X channels, respectively OLpitchpri and OLpitchsec. The pitch coherence analyzer <NUM> of <FIG> is shown in greater details in <FIG>, which is a block diagram illustrating concurrently sub-operations of the pitch coherence analysis operation <NUM> and modules of the pitch coherence analyzer <NUM>. <FIG> and its description are useful for understanding the invention but are not covered by the claims.

The pitch coherence analysis operation <NUM> performs an evaluation of the similarity of the open loop pitches between the primary channel Y and the secondary channel X to decide in what circumstances the primary open loop pitch can be re-used in coding the secondary channel X. To this end, the pitch coherence analysis operation <NUM> comprises a primary channel open loop pitches summation sub-operation <NUM> performed by a primary channel open loop pitches adder <NUM>, and a secondary channel open loop pitches summation sub-operation <NUM> performed by a secondary channel open loop pitches adder <NUM>. The summation from adder <NUM> is subtracted (sub-operation <NUM>) from the summation from adder <NUM> using a subtractor <NUM>. The result of the subtraction from sub-operation <NUM> provides a stereo pitch coherence. As an non-limitative example, the summations in sub-operations <NUM> and <NUM> are based on three (<NUM>) previous, consecutive open loop pitches available for each channel Y and X. The open loop pitches can be computed, for example, as defined in clause <NUM>. <NUM> of Reference [<NUM>]. The stereo pitch coherence Spc is computed in sub-operations <NUM>, <NUM> and <NUM> using relation (<NUM>) : <MAT>
where pp|s(i) represent the open loop pitches of the primary Y and secondary X channels and i represents the position of the open loop pitches.

When the stereo pitch coherence is below a predetermined threshold Δ, re-use of the pitch information from the primary channel Y may be allowed depending of an available bit budget to encode the secondary channel X. Also, depending of the available bit budget, it is possible to limit re-use of the pitch information for signals that have a voiced characteristic for both the primary Y and secondary X channels.

To this end, the pitch coherence analysis operation <NUM> comprises a decision sub-operation <NUM> performed by a decision module <NUM> which consider the available bit budget and the characteristics of the sound signal (indicated for example by the primary and secondary channel coding modes). When the decision module <NUM> detects that the available bit budget is sufficient or the sound signals for both the primary Y and secondary X channels have no voiced characteristic, the decision is to encode the pitch information related to the secondary channel X (<NUM>).

When the decision module <NUM> detects that the available bit budget is low for the purpose of encoding the pitch information of the secondary channel X or the sound signals for both the primary Y and secondary X channels have a voiced characteristic, the decision module compares the stereo pitch coherence Spc to the threshold Δ. When the bit budget is low, the threshold Δ is set to a larger value compared to the case where the bit budget more important (sufficient to encode the pitch information of the secondary channel X). When the absolute value of the stereo pitch coherence Spc is smaller than or equal to the threshold Δ, the module <NUM> decides to re-use the pitch information from the primary channel Y to encode the secondary channel X (<NUM>). When the value of the stereo pitch coherence Spc is higher than the threshold Δ, the module <NUM> decides to encode the pitch information of the secondary channel X (<NUM>).

Ensuring the channels have voiced characteristics increases the likelihood of a smooth pitch evolution, thus reducing the risk of adding artefacts by re-using the pitch of the primary channel. As a non-limitative example, when the stereo bit budget is below <NUM> kb/s and the stereo pitch coherence Spc is below or equal to a <NUM> (Δ = <NUM>), the primary pitch information can be re-used in encoding the secondary channel X. According to another non-limitative example, if the stereo bit budget is above <NUM> kb/s and below <NUM> kb/s, then both the primary Y and secondary X channels are considered as voiced and the stereo pitch coherence Spc is compared to a lower threshold Δ = <NUM>, which leads to a smaller re-use rate of the pitch information of the primary channel Y at a bit-rate of <NUM> kb/s.

Referring back to <FIG>, the bit allocation estimator <NUM> is supplied with the factor β from the channel mixer <NUM>/<NUM>, with the decision to re-use the primary channel LP filter coefficients or to use and encode the secondary channel LP filter coefficients from the LP filter coherence analyzer <NUM>, and with the pitch information determined by the pitch coherence analyzer <NUM>. Depending on primary and secondary channel encoding requirements, the bit allocation estimator <NUM> provides a bit budget for encoding the primary channel Y to the primary channel encoder <NUM>/<NUM> and a bit budget for encoding the secondary channel X to the decision module <NUM>. In one possible implementation, for all content that is not INACTIVE, a fraction of the total bit-rate is allocated to the secondary channel. Then, the secondary channel bit-rate will be increased by an amount which is related to an energy normalization (rescaling) factor ε described previously as: <MAT> where Bx represents the bit-rate allocated to the secondary channel X, Bt represents the total stereo bit-rate available, BM represents the minimum bit-rate allocated to the secondary channel and is usually around <NUM>% of the total stereo bitrate. Finally, ε represents the above described energy normalization factor. Hence, the bit-rate allocated to the primary channel corresponds to the difference between the total stereo bit-rate and the secondary channel stereo bit-rate. In an alternative implementation the secondary channel bit-rate allocation can be described as: <MAT>
where again Bx represents the bit-rate allocated to the secondary channel X, Bt represents the total stereo bit-rate available and BM represents the minimum bit-rate allocated to the secondary channel. Finally, εidx represents a transmitted index of the energy normalization factor. Hence, the bit-rate allocated to the primary channel corresponds to the difference between the total stereo bit-rate and the secondary channel bit-rate. In all cases, for INACTIVE content, the secondary channel bit-rate is set to the minimum bit-rate needed to encode the spectral shape of the secondary channel giving a bitrate usually close to <NUM> kb/s.

Meanwhile, the signal classifier <NUM> provides a signal classification of the secondary channel X to the decision module <NUM>. If the decision module <NUM> determines that the sound signal is inactive or unvoiced, the unvoiced/inactive encoding module <NUM> provides the spectral shape of the secondary channel X to the multiplexer <NUM>/<NUM>. Alternatively, the decision module <NUM> informs the decision module <NUM> when the sound signal is neither inactive nor unvoiced. For such sound signals, using the bit budget for encoding the secondary channel X, the decision module <NUM> determines whether there is a sufficient number of available bits for encoding the secondary channel X using the four (<NUM>) subframes model generic only encoding module <NUM>; otherwise the decision module <NUM> selects to encode the secondary channel X using the two (<NUM>) subframes model encoding module <NUM>. To choose the four subframes model generic only encoding module, the bit budget available for the secondary channel must be high enough to allocate at least <NUM> bits to the algebraic codebooks, once everything else is quantized or reused, including the LP coefficient and the pitch information and gains.

As will be understood from the above description, in the four (<NUM>) subframes model generic only encoding operation <NUM> and the corresponding four (<NUM>) subframes model generic only encoding module <NUM>, to keep the bit-rate as low as possible, an ACELP search as described in clause <NUM>. <NUM> of Reference [<NUM>] is used. In the four (<NUM>) subframes model generic only encoding, the pitch information can be re-used from the primary channel or not. The coding parameters found during the ACELP search in the four (<NUM>) subframes model generic only encoding module <NUM> are then used to construct the secondary channel bitstream <NUM>/<NUM> and sent to the multiplexer <NUM>/<NUM> for inclusion in the multiplexed bitstream <NUM>/<NUM>.

In the alternative two (<NUM>) subframes model encoding operation <NUM> and the corresponding alternative two (<NUM>) subframes model encoding module <NUM>, the generic coding model is constructed similarly to ACELP as described in clause <NUM>. <NUM> of Reference [<NUM>], but it is used with only two (<NUM>) sub-frames by frame. Thus, to do so, the length of the subframes is increased from <NUM> samples to <NUM> samples, still keeping the internal sampling rate at <NUM>. If the pitch coherence analyzer <NUM> has determined to re-use the pitch information from the primary channel Y for encoding the secondary channel X, then the average of the pitches of the first two subframes of the primary channel Y is computed and used as the pitch estimation for the first half frame of the secondary channel X. Similarly, the average of the pitches of the last two subframes of the primary channel Y is computed and used for the second half frame of the secondary channel X. When re-used from the primary channel Y, the LP filter coefficients are interpolated and interpolation of the LP filter coefficients as described in clause <NUM>. <NUM> of Reference [<NUM>] is modified to adapt to a two (<NUM>) subframes scheme by replacing the first and third interpolation factors with the second and fourth interpolation factors.

In the embodiment of <FIG>, the process to decide between the four (<NUM>) subframes and the two (<NUM>) subframes encoding scheme is driven by the bit budget available for encoding the secondary channel X. As mentioned previously, the bit budget of the secondary channel X is derived from different elements such as the total bit budget available, the factor β or the energy normalization factor ε, the presence or not of a temporal delay correction (TDC) module, the possibility or not to re-use the LP filter coefficients and/or the pitch information from the primary channel Y.

The absolute minimum bit rate used by the two (<NUM>) subframes encoding model of the secondary channel X when both the LP filter coefficients and the pitch information are re-used from the primary channel Y is around <NUM> kb/s for a generic signal while it is around <NUM> kb/s for the four (<NUM>) subframes encoding scheme. For an ACELP-like coder, using a two (<NUM>) or four (<NUM>) subframes encoding model, a large part of the quality is coming from the number of bit that can be allocated to the algebraic codebook (ACB) search as defined in clause <NUM>. <NUM> of reference [<NUM>].

Then, to maximize the quality, the idea is to compare the bit budget available for both the four (<NUM>) subframes algebraic codebook (ACB) search and the two (<NUM>) subframes algebraic codebook (ACB) search after that all what will be coded is taken into account. For example, if, for a specific frame, there is <NUM> kb/s (<NUM> bits per <NUM> frame) available to code the secondary channel X and the LP filter coefficient can be re-used while the pitch information needs to be transmitted. Then is removed from the <NUM> bits, the minimum amount of bits for encoding the secondary channel signaling, the secondary channel pitch information, the gains, and the algebraic codebook for both the two (<NUM>) subframes and the four (<NUM>) subframes, to get the bit budget available to encode the algebraic codebook. For example, the four (<NUM>) subframes encoding model is chosen if at least <NUM> bits are available to encode the four (<NUM>) subframes algebraic codebook otherwise, the two (<NUM>) subframe scheme is used.

As described in the foregoing description, the time domain down-mixing is mono friendly, meaning that in case of an embedded structure, where the primary channel Y is encoded with a legacy codec (It should be kept in mind that, as mentioned in the foregoing description, any suitable type of encoder can be used as the primary channel encoder <NUM>/<NUM>) and the stereo bits are appended to the primary channel bitstream, the stereo bits could be stripped-off and a legacy decoder could create a synthesis that is subjectively close to an hypothetical mono synthesis. To do so, simple energy normalization is needed on the encoder side, before encoding the primary channel Y. By rescaling the energy of the primary channel Y to a value sufficiently close to an energy of a monophonic signal version of the sound, decoding of the primary channel Y with a legacy decoder can be similar to decoding by the legacy decoder of the monophonic signal version of the sound. The function of the energy normalization is directly linked to the linearized long-term correlation difference <MAT> computed using relation (<NUM>) and is computed using relation (<NUM>): <MAT>.

The level of normalization is shown in <FIG>. In practice, instead of using relation (<NUM>), a look-up table is used relating the normalization values ε to each possible value of the factor β (<NUM> values in this example embodiment). Even if this extra step is not required when encoding a stereo sound signal, for example speech and/or audio, with the integrated model, this can be helpful when decoding only the mono signal without decoding the stereo bits.

<FIG> is a block diagram illustrating concurrently a stereo sound decoding method and stereo sound decoding system. <FIG> is a block diagram illustrating additional features of the stereo sound decoding method and stereo sound decoding system of <FIG> and <FIG> and their description are useful for understanding the invention but are not covered by the claims.

The stereo sound decoding method of <FIG> and <FIG> comprises a demultiplexing operation <NUM> implemented by a demultiplexer <NUM>, a primary channel decoding operation <NUM> implemented by a primary channel decoder <NUM>, a secondary channel decoding operation <NUM> implemented by a secondary channel decoder <NUM>, and a time domain up-mixing operation <NUM> implemented by a time domain channel up-mixer <NUM>. The secondary channel decoding operation <NUM> comprises, as shown in <FIG>, a decision operation <NUM> implemented by a decision module <NUM>, a four (<NUM>) subframes generic decoding operation <NUM> implemented by a four (<NUM>) subframes generic decoder <NUM>, and a two (<NUM>) subframes generic/unvoiced/inactive decoding operation <NUM> implemented by a two (<NUM>) subframes generic/unvoiced/inactive decoder <NUM>.

At the stereo sound decoding system, a bitstream <NUM> is received from an encoder. The demultiplexer <NUM> receives the bitstream <NUM> and extracts therefrom encoding parameters of the primary channel Y (bitstream <NUM>), encoding parameters of the secondary channel X (bitstream <NUM>), and the factor β supplied to the primary channel decoder <NUM>, the secondary channel decoder <NUM> and the channel up-mixer <NUM>. As mentioned earlier, the factor β is used as an indicator for both the primary channel encoder <NUM>/<NUM> and the secondary channel encoder <NUM>/<NUM> to determine the bit-rate allocation, thus the primary channel decoder <NUM> and the secondary channel decoder <NUM> are both re-using the factor β to decode the bitstream properly.

The primary channel encoding parameters correspond to the ACELP coding model at the received bit-rate and could be related to a legacy or modified EVS coder (It should be kept in mind here that, as mentioned in the foregoing description, any suitable type of encoder can be used as the primary channel encoder <NUM>). The primary channel decoder <NUM> is supplied with the bitstream <NUM> to decode the primary channel encoding parameters (codec mode<NUM>, β, LPC<NUM>, Pitch<NUM>, fixed codebook indices<NUM>, and gains<NUM> as shown in <FIG>) using a method similar to Reference [<NUM>] to produce a decoded primary channel Y'.

The secondary channel encoding parameters used by the secondary channel decoder <NUM> correspond to the model used to encode the second channel X and may comprise:.

The received encoding parameters corresponding to the secondary channel X (bitstream <NUM>) contain information (codec mode<NUM>) related to the coding model being used. The decision module <NUM> uses this information (codec mode<NUM>) to determine and indicate to the four (<NUM>) subframes generic decoder <NUM> and the two (<NUM>) subframes generic/unvoiced/inactive decoder <NUM> which coding model is to be used.

In case of an embedded structure, the factor β is used to retrieve the energy scaling index that is stored in a look-up table (not shown) on the decoder side and used to rescale the primary channel Y' before performing the time domain up-mixing operation <NUM>. Finally the factor β is supplied to the channel up-mixer <NUM> and used for up-mixing the decoded primary Y' and secondary X' channels. The time domain up-mixing operation <NUM> is performed as the inverse of the down-mixing relations (<NUM>) and (<NUM>) to obtain the decoded right R' and left L' channels, using relations (<NUM>) and (<NUM>): <MAT> <MAT>
where n=<NUM>,. ,N-<NUM> is the index of the sample in the frame and t is the frame index.

For applications of the present technique where a frequency domain coding mode is used, performing the time down-mixing in the frequency domain to save some complexity or to simplify the data flow is also contemplated. In such cases, the same mixing factor is applied to all spectral coefficients in order to maintain the advantages of the time domain down mixing. It may be observed that this is a departure from applying spectral coefficients per frequency band, as in the case of most of the frequency domain down-mixing applications. The down mixer <NUM> may be adapted to compute relations (<NUM>) and (<NUM>): <MAT> <MAT>
where FR(k) represents a frequency coefficient k of the right channel R and, similarly, FL(k) represents a frequency coefficient k of the left channel L. The primary Y and secondary X channels are then computed by applying an inverse frequency transform to obtain the time representation of the down mixed signals.

<FIG> and <FIG> show possible implementations of time domain stereo encoding method and system using frequency domain down mixing capable of switching between time domain and frequency domain coding of the primary Y and secondary X channels.

A first variant of such method and system is shown in <FIG>, which is a block diagram illustrating concurrently stereo encoding method and system using time-domain down-switching with a capability of operating in the time-domain and in the frequency domain.

In <FIG>, the stereo encoding method and system includes many previously described operations and modules described with reference to previous figures and identified by the same reference numerals. A decision module <NUM> (decision operation <NUM>) determines whether left L' and right R' channels from the temporal delay corrector <NUM> should be encoded in the time domain or in the frequency domain. If time domain coding is selected, the stereo encoding method and system of <FIG> operates substantially in the same manner as the stereo encoding method and system of the previous figures, for example and without limitation as in the embodiment of <FIG>.

If the decision module <NUM> selects frequency coding, a time-to-frequency converter <NUM> (time-to-frequency converting operation <NUM>) converts the left L' and right R' channels to frequency domain. A frequency domain down mixer <NUM> (frequency domain down mixing operation <NUM>) outputs primary Y and secondary X frequency domain channels. The frequency domain primary channel is converted back to time domain by a frequency-to-time converter <NUM> (frequency-to-time converting operation <NUM>) and the resulting time domain primary channel Y is applied to the primary channel encoder <NUM>/<NUM>. The frequency domain secondary channel X from the frequency domain down mixer <NUM> is processed through a conventional parametric and/or residual encoder <NUM> (parametric and/or residual encoding operation <NUM>).

<FIG> is a block diagram illustrating concurrently other stereo encoding method and system using frequency domain down mixing with a capability of operating in the time-domain and in the frequency domain. In <FIG>, the stereo encoding method and system are similar to the stereo encoding method and system of <FIG> and only the new operations and modules will be described.

A time domain analyzer <NUM> (time domain analyzing operation <NUM>) replaces the earlier described time domain channel mixer <NUM>/<NUM> (time domain down mixing operation <NUM>/<NUM>). The time domain analyzer <NUM> includes most of the modules of <FIG>, but without the time domain down mixer <NUM>. Its role is thus in a large part to provide a calculation of the factor β. This factor β is supplied to the pre-processor <NUM> and to frequency-to-time domain converters <NUM> and <NUM> (frequency-to-time domain converting operations <NUM> and <NUM>) that respectively convert to time domain the frequency domain secondary X and primary Y channels received from the frequency domain down mixer <NUM> for time domain encoding. The output of the converter <NUM> is thus a time domain secondary channel X that is provided to the preprocessor <NUM> while the output of the converter <NUM> is a time domain primary channel Y that is provided to both the preprocessor <NUM> and the encoder <NUM>/<NUM>.

<FIG> is a simplified block diagram of an example configuration of hardware components forming each of the above described stereo sound encoding system and stereo sound decoding system.

Each of the stereo sound encoding system and stereo sound decoding system may be implemented as a part of a mobile terminal, as a part of a portable media player, or in any similar device. Each of the stereo sound encoding system and stereo sound decoding system (identified as <NUM> in <FIG>) comprises an input <NUM>, an output <NUM>, a processor <NUM> and a memory <NUM>.

The input <NUM> is configured to receive the left L and right R channels of the input stereo sound signal in digital or analog form in the case of the stereo sound encoding system, or the bitstream <NUM> in the case of the stereo sound decoding system. The output <NUM> is configured to supply the multiplexed bitstream <NUM>/<NUM> in the case of the stereo sound encoding system or the decoded left channel L' and right channel R' in the case of the stereo sound decoding system. The input <NUM> and the output <NUM> may be implemented in a common module, for example a serial input/output device.

The processor <NUM> is operatively connected to the input <NUM>, to the output <NUM>, and to the memory <NUM>. The processor <NUM> is realized as one or more processors for executing code instructions in support of the functions of the various modules of each of the stereo sound encoding system as shown in <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG>, <FIG> and <FIG> and the stereo sound decoding system as shown in <FIG> and <FIG>.

The memory <NUM> may comprise a non-transient memory for storing code instructions executable by the processor <NUM>, specifically, a processor-readable memory comprising non-transitory instructions that, when executed, cause a processor to implement the operations and modules of the stereo sound encoding method and system and the stereo sound decoding method and system as described in the present disclosure. The memory <NUM> may also comprise a random access memory or buffer(s) to store intermediate processing data from the various functions performed by the processor <NUM>.

Those of ordinary skill in the art will realize that the description of the stereo sound encoding method and system and the stereo sound decoding method and system are illustrative only and are not intended to be in any way limiting. Other embodiments will readily suggest themselves to such persons with ordinary skill in the art having the benefit of the present disclosure. Furthermore, the disclosed stereo sound encoding method and system and stereo sound decoding method and system may be customized to offer valuable solutions to existing needs and problems of encoding and decoding stereo sound.

In the interest of clarity, not all of the routine features of the implementations of the stereo sound encoding method and system and the stereo sound decoding method and system are shown and described. It will, of course, be appreciated that in the development of any such actual implementation of the stereo sound encoding method and system and the stereo sound decoding method and system, numerous implementation-specific decisions may need to be made in order to achieve the developer's specific goals, such as compliance with application-, system-, network- and business-related constraints, and that these specific goals will vary from one implementation to another and from one developer to another. Moreover, it will be appreciated that a development effort might be complex and time-consuming, but would nevertheless be a routine undertaking of engineering for those of ordinary skill in the field of sound processing having the benefit of the present disclosure.

In accordance with the present disclosure, the modules, processing operations, and/or data structures described herein may be implemented using various types of operating systems, computing platforms, network devices, computer programs, and/or general purpose machines. In addition, those of ordinary skill in the art will recognize that devices of a less general purpose nature, such as hardwired devices, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), or the like, may also be used. Where a method comprising a series of operations and sub-operations is implemented by a processor, computer or a machine and those operations and sub-operations may be stored as a series of non-transitory code instructions readable by the processor, computer or machine, they may be stored on a tangible and/or non-transient medium.

Modules of the stereo sound encoding method and system and the stereo sound decoding method and decoder as described herein may comprise software, firmware, hardware, or any combination(s) of software, firmware, or hardware suitable for the purposes described herein.

In the stereo sound encoding method and the stereo sound decoding method as described herein, the various operations and sub-operations may be performed in various orders and some of the operations and sub-operations may be optional.

Although the present disclosure has been described hereinabove by way of non-restrictive, illustrative embodiments thereof, these embodiments may be modified at will within the scope of the appended claims.

Claim 1:
A stereo sound encoding method for encoding left and right channels of a stereo sound signal, comprising:
down mixing the left and right channels of the stereo sound signal to produce primary and secondary channels;
encoding the primary channel and encoding the secondary channel, wherein encoding the primary channel and encoding the secondary channel comprise determining a first bit budget to encode the primary channel and a second bit budget to encode the secondary channel;
if the second bit budget is sufficient, the secondary channel is encoded using a four subframes encoding model; and
if the second bit budget is insufficient for using the four sub-frames encoding model, the secondary channel is encoded using a two sub-frames encoding model;
wherein encoding the primary channel comprises producing primary channel coding parameters and encoding the secondary channel comprises producing secondary channel coding parameters; and
wherein encoding the secondary channel comprises:
- determining from the second bit budget a third budget required to encode, in a current frame, secondary channel coding parameters including
- (a) linear prediction, LP, filter coefficients and/or (b) pitch information, and
- gains,
that are not re-used from the primary channel encoding;
- determining if a remaining bit budget, remaining from the second bit budget to encode the secondary channel, allows to quantize, in the current frame, four algebraic codebooks or only two algebraic codebooks.