# Patent

## Title
Method and apparatus for determining coding mode

## Abstract

Provided is a method and apparatus for determining a signal coding mode. The signal coding mode may be determined or changed according to whether a current frame corresponds to a silence period and by using a history of speech or music presence possibilities.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is a continuation application of U.S. patent application Ser. No. 12/458,385, filed on Jul. 9, 2009, which claims the benefit of Korean Patent Application No. 10-2008-0066737, filed on Jul. 9, 2008, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.


BACKGROUND
1. Field
One or more embodiments relate to a method and apparatus for encoding or decoding an audio signal with music and speech characteristics, and more particularly, to a method and apparatus for efficiently encoding and decoding such an audio signal by using a small number of bits.
2. Description of the Related Art
When coding audio, one of a plurality of various coding modes may be selected to code an input signal by analyzing the characteristic of the input signal. For example, a frequency-domain coding mode such as an advanced audio codec (AAC) method or a time-domain coding mode such as a code excited linear prediction (CELP) method may be selected to code the input signal. Conventionally, if the characteristic of the input signal is determined to more closely represent characteristics of music, the frequency-domain coding mode is selected to code the input signal. If the characteristic of the input signal is determined to more closely represent characteristics of speech, the time-domain coding mode is selected to code the input signal.
Here, in such an operation, when a coding mode of an input signal is selected, the characteristics of signals in previous frames may be stored and the coding mode of a current frame may be determined based on the stored characteristics of the previous frames as well as characteristic of the current frame. However, in such an approach, both the number of times that a signal coding mode changes, and any corresponding delay caused by such changes, should be reduced.
SUMMARY
One or more embodiments include a method and apparatus for determining an efficient signal coding mode from among a plurality of coding modes.
According to one or more embodiments, there is provided a coding mode determination method with a determined coding mode of a signal in a current frame being based on stored information or parameters regarding signals in one or more previous frames, the method including determining whether the signal in the current frame corresponds to a silence period, and resetting the stored information or parameters when the signal in the current frame corresponds to the silence period.
According to one or more embodiments, there is provided a coding mode determination method including determining a coding mode of a signal in a current frame, calculating a speech or music presence possibility of the signal in the current frame, determining whether to change the determined coding mode based on a history of speech or music presence possibilities of signals in one or more previous frames and the calculated speech or music presence possibility, and changing the determined coding mode when the determining of whether to change the determined coding mode indicates that the coding mode should change.
According to one or more embodiments, there is provided a coding mode determination apparatus including a storage unit storing information or parameters regarding signals in one or more previous frames, a coding mode determination unit determining a coding mode of a signal in a current frame by using the stored information or parameters, a silence period determination unit determining whether the signal in the current frame corresponds to a silence period, and a reset unit resetting the stored information or parameters if the signal in the current frame corresponds to the silence period.
According to one or more embodiments, there is provided a coding mode determination apparatus including a coding mode determination unit determining a coding mode of a signal in a current frame, a signal analysis unit calculating a speech or music presence possibility of the signal in the current frame, a change determination unit determining whether to change the determined coding mode based on a history of speech or music presence possibilities of signals in one or more previous frames and the calculated speech or music presence possibility, and a mode change unit changing the determined coding mode when the change determination unit determines to change the determined coding mode.
According to one or more embodiments, there is provided a computer readable recording medium having recorded thereon computer readable code to control at least one processing device to implement a coding mode determination method with a determined coding mode of a signal in a current frame being based on stored information or parameters regarding signals in one or more previous frames, the method including determining whether the signal in the current frame corresponds to a silence period, and resetting the stored information or parameters when the signal in the current frame corresponds to the silence period.
According to one or more embodiments, there is provided a computer readable recording medium having recorded thereon computer readable code to control at least one processing device to implement a coding mode determination method, the method including determining a coding mode of a signal in a current frame, calculating a speech or music presence possibility of the signal in the current frame, determining whether to change the determined coding mode based on a history of speech or music presence possibilities of signals in one or more previous frames and the calculated speech or music presence possibility, and changing the determined coding mode when the determining of whether to change the determined coding mode indicates that the coding mode should change.
Additional aspects will be set forth in part in the description which follows and, in part, will be apparent from the description, or may be learned by practice of the presented embodiments.



BRIEF DESCRIPTION OF THE DRAWINGS
These and/or other aspects will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 illustrates a coding mode determination method, according to one or more embodiments;
FIG. 2 illustrates a coding mode determination method, according to one or more embodiments;
FIG. 3 illustrates a method of calculating a history value of speech presence possibilities (SPPs), according to one or more embodiments;
FIG. 4 illustrates a coding mode changing operation of a coding mode determination method, such as the coding mode determination method of FIG. 2, according to one or more embodiments;
FIG. 5 illustrates a coding mode determination method, according to one or more embodiments;
FIG. 6 illustrates a silence period and a non-silence period, according to one or more embodiments;
FIG. 7 illustrates a coding mode determination apparatus, according to one or more embodiments;
FIG. 8 illustrates a coding mode determination apparatus, according to one or more embodiments; and
FIG. 9 illustrates a coding mode determination apparatus, according to one or more embodiments.



DETAILED DESCRIPTION OF EMBODIMENTS
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. In this regard, the present embodiments may have different forms and should not be construed as being limited to the descriptions set forth herein. Accordingly, the embodiments are merely described below, by referring to the figures, to explain aspects of the present description.
FIG. 1 illustrates a coding mode determination method, according to one or more embodiments.
Referring to FIG. 1, initially, a determination is made as to whether a signal in a current frame corresponds to a silence period (operation 100). The determination in operation 100 may be performed based on the energy or the characteristic of the signal in the current frame. As only an example, if the energy is less than a threshold value, it may be determined that the signal in the current frame corresponds to the silence period, noting that additional and/or alternative silence detecting techniques are equally available.
If the determination of operation 100 indicates that the signal in the current frame corresponds to a silence period, there may be a reset of information or parameters regarding signals in one or more previous frames. The information or parameters may have been stored for subsequent use in determining an appropriate coding mode of the signal, such as in the current frame, from among a plurality of signal coding modes (operation 110).
The information or the parameters regarding the signals in the previous frames may be information or parameters regarding long-term signal features, for example. In operation 110, from among the long-term features, a mean value regarding short-term features of signals in a pre-set number of previous frames, or a history value of speech or music presence possibilities of a signal in a predetermined frame may be reset, for example.
Here, the long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. For example, long-term features may include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities. A short-term feature refers to a peculiar characteristic of each frame and may include at least one selected from the group including information or parameters such as a linear prediction-long term prediction (LP-LTP) gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation, for example.
After operation 110 is performed, a determination made as to whether to code the signal in the current frame in a same coding mode as a signal in an immediately previous frame (operation 120).
If the determination of operation 100 indicates that the signal in the current frame does not correspond to a silence period, an analysis of the current frame is performed to analyze a characteristic of the signal in the current frame, e.g., so as to extract information or a parameter regarding the signal in the current frame. A determination is then made as to what coding mode, from among a plurality of signal coding modes, should be used for the signal in the current frame based on the information or the parameters regarding the signals in the previous frames and the information or the parameter regarding the signal in the current frame (operation 130). Examples of the information or the parameter regarding the signal in the current frame, which is extracted in operation 130, include the above-described short-term and long-term features.
Here, examples of such signal coding modes include a time-domain coding mode such as a code excited linear prediction (CELP) method and a frequency-domain coding mode such as a transform coded excitation (TCX) method or an advanced audio codec (AAC) method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
After operation 120 or operation 130 is performed, a determination is made as to whether the current frame is a last frame (operation 140).
If the determination of operation 140 indicates that the current frame is not the last frame, a subsequent frame may be received (operation 150) and operations 100 through 150 may be repeatedly performed on the subsequent frame(s).
FIG. 2 illustrates a coding mode determination method, according to one or more embodiments.
Referring to FIG. 2, initially, the characteristic of a signal in a current frame is analyzed so as to extract information or a parameter regarding the signal in the current frame (operation 200). Examples of the information or the parameter extracted in operation 200 include short-term and long-term features, for example. A short-term feature refers to a peculiar characteristic of each frame and may include at least one of information or parameters such as an LP-LTP gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation, for example. The process may further include a selection of one or more of these information or parameters. A long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. For example, the long-term feature may include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities, for example.
From among the long-term features, a speech presence possibility (SPP) may be calculated by using the below Equation 1, for example. Hereinafter, the SPP will be representatively described. However, embodiments of the present invention are not limited to the SPP.

SPP=SNR_W·SNR_SP+TILT_W·TILT_SP+ZC_W·ZC_SP 

Here, SNR_W represents a weight on SNR_SP, TILT_W represents a weight on TILT_SP, ZC_W represents a weight on ZC_SP, SNR_SP represents a long-term feature regarding an LP-LTP gain and may be calculated by using Equation 2, TILT_SP represents a long-term feature regarding a spectrum tilt and may be calculated by using the below Equation 3, for example, and ZC_SP represents a long-term feature regarding a zero crossing rate and may be calculated by using the below Equation 4, again as only an example.

if (SNR_VAR>SNR_THR)

SNR_SP=a*SNR_SP+(1−a)*SNR_VAR

else

SNR_SP−=D1  Equation 2:

Here, SNR_VAR represents a difference value or an absolute value of a difference value between an LP-LTP gain of a current frame and a mean value of LT-LIP gains of a predetermined number of frames prior to the current frame, SNR_THR represents a threshold value, SNR_SP has an initial value of 0, a is a real number between 0 and 1 and represents a weight on SNR_SP and SNR_VAR, D1 is β1×(SNR_THR/an LT-LIP gain), and β1 is a constant representing a degree of decrease.

if (TILT_VAR>TILT_THR)

TILT_SP=a2*TILT_SP+(1−a2)*TILT_VAR

else

TILT_SP−=D2  Equation 3:

Here, TILT_VAR represents a difference value or an absolute value of a difference value between a spectrum tilt of a current frame and a mean value of spectrum tilts of a predetermined number of frames prior to the current frame, TILT_THR represents a threshold value, TILT_SP has an initial value of 0, a2 is a real number between 0 and 1 and represents a weight on TILT_SP and TILT_VAR, D2 is β2×(TILT_THR/a spectrum tilt), and β2 is a constant representing a degree of decrease.

if (ZC_VAR>ZC_THR)

ZC_SP=a3*ZC_SP+(1−a3)*ZC_VAR

else

ZC_SP−=D3  Equation 4:

Here, ZC_VAR represents a difference value or an absolute value of a difference value between a zero crossing rate of a current frame and a mean value of zero crossing rates of a predetermined number of frames prior to the current frame, ZC_THR represents a threshold value, ZC_SP has an initial value of 0, a3 is a real number between 0 and 1 and represents a weight on ZC_SP and ZC_VAR, D3 is β3×(ZC_THR/a zero-crossing rate), and β3 is a constant representing a degree of decrease.
In addition, the history value of the speech or music presence possibilities refers to a value obtained by applying weights to speech or music presence possibilities of signals in a predetermined number of frames and accumulating the speech or music presence possibilities. A method of calculating a history value of SPPs will be representatively described later with reference to FIG. 3, as only an example.
A coding mode of the signal in the current frame may be selected from among a plurality of available signal coding modes by using the information or the parameter regarding the signal in the current frame, which is extracted in operation 200 (operation 210). Examples of the signal coding modes include a time-domain coding mode such as a CELP method and a frequency-domain coding mode such as a TCX method or an AAC method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
After performing operation 210, a determination is made as to whether to change the coding mode selected in operation 210, by using a coding mode of a signal in one or more previous frames, and/or speech or music presence possibilities of signals in a predetermined number of previous frames and the signal in the current frame (operation 220). The speech or music presence possibilities of the signals in the previous frames and the signal in the current frame may be represented by the above-described history value of the speech or music presence possibilities, for example.
If the determination of operation 220 indicates to change the coding mode selected in operation 210, the coding mode determined in operation 210 is changed (operation 230).
If the determination of operation 220 indicates to not change the coding mode selected in operation 210, or after performing operation 230, a determination is then made as to whether the current frame is a last frame (operation 240).
If the determination of operation 240 indicates that the current frame is not the last frame, a subsequent frame may be received (operation 250) and operations 200 through 240 may be repeatedly performed on the subsequent frame(s). The coding mode used for the current frame may be stored along with corresponding information or parameters for determining the coding mode of such subsequent frames.
FIG. 3 illustrates a method of calculating a history value of SPPs, according to one or more embodiments.
Referring to FIG. 3, a determination is made as to whether a coding mode of a signal in a current frame, e.g., as determined in operation 210 in FIG. 2, is a zeroth mode or a first mode (operation 300). Here, the zeroth mode refers to a frequency-domain coding mode or a music coding mode, and the first mode refers to a time-domain coding mode or a speech coding mode.
If the determination of operation 300 indicates that the coding mode selected in operation 210 should be the first mode, a history value in the zeroth mode is calculated by using the below example Equation 5 (operation 310).

Mode0_Hysteresis+=(y−(100−SPP)/100·*z)  Equation 5:

Here, Mode0_Hysteresis represents a history value in the zeroth mode, and y and z represent pre-set values, for example.
After performing operation 310, a history value in the first mode may be calculated by using the below example Equation 6 (operation 320).

Mode1_Hysteresis+=(x*(SPP/100))  Equation 6:

Here, Mode1_Hysteresis represents a history value in the first mode, and x represents a pre-set value, for example.
Otherwise, if the determination of operation 300 indicates that the coding mode selected in operation 210 should be the zeroth mode, the history value in the zeroth mode may be calculated by using the below example Equation 7 (operation 330).

Mode0_Hysteresis+=(w*((100−SPP)/100))  Equation 7:

Here, Mode0_Hysteresis represents a history value in the zeroth mode, and w represents a pre-set value, for example.
After performing operation 330, the history value in the first mode may be calculated by using the below example Equation 8 (operation 340).

Mode1_Hysteresis+=(u+((SPP/100)*v))  Equation 8:

Here, Mode1_Hysteresis represents a history value in the first mode, and u and v represent pre-set values, for example.
However, minimum and maximum values regarding a history value of speech or music presence possibilities may be previously set. For example, the minimum value of the history value may be set as 0 and the maximum value of the history value may be set as 1. If a variation range of the history value is reduced by reducing a range between the minimum and maximum values, the number of times that a signal coding mode is permitted to change may be increased and a delay caused when the signal coding mode is changed may be reduced. On the other hand, if a variation range of the history value is increased by increasing a range between the minimum and maximum values, the number of times that a signal coding mode is permitted to change may be reduced and a delay caused when the signal coding mode is changed may be increased. Thus, the minimum and maximum values of the history value may be previously controlled and set according to a coding environment or the characteristic of a signal.
FIG. 4 illustrates a coding mode changing operation of a coding mode determination method, such as the coding changing operation 220 in FIG. 2, according to one or more embodiments.
Referring to FIG. 4, initially, a determination is made as to whether a coding mode of a signal for a current frame, e.g., as selected in operation 210, is a zeroth mode or a first mode (operation 400). Here, the zeroth mode refers to a frequency-domain coding mode or a music coding mode, and the first mode refers to a time-domain coding mode or a speech coding mode.
If the determination of operation 400 indicates that the selected coding mode is the first mode, there may then be a determination as to whether a coding mode of a signal in an immediately previous frame, for example, is the zeroth mode or the first mode (operation 410).
If the determination of operation 410 indicates that the coding mode of the signal in the immediately previous frame is the zeroth mode, there may be a further determination as to whether a history value in the zeroth mode is greater than an example 0 (operation 420).
If the determination of operation 420 indicates that the history value in the zeroth mode is greater than the example 0, the coding mode of the signal for the current frame, e.g., as selected in operation 210, may be changed from the first mode to the zeroth mode (operation 230).
Otherwise, if the determination of operation 410 indicates that the coding mode of the signal in the immediately previous frame is the first mode or the determination of operation 420 indicates that the history value in the zeroth mode is 0, the coding mode of the signal for the current frame, e.g., as selected in operation 210, would not be changed. Here, a case when the history value in the zeroth mode is 0, for example, may refer to a case when the history value in the zeroth mode corresponds to a pre-set minimum value or a case when the signal in the immediately previous frame, for example, corresponds to a silence period and thus is reset.
Otherwise, if the determination of operation 400 indicates that the coding mode selected in operation 210 is the zeroth mode, a determination is then made as to whether the coding mode of the signal in the immediately previous frame, for example, is the zeroth mode or the first mode (operation 430).
If the determination of operation 430 indicates that the coding mode of the signal in the immediately previous frame, for example, is the first mode, a determination is then made as to whether a history value in the first mode is greater than an example 0 (operation 440).
If the determination of operation 440 indicates that the history value in the first mode is greater than the example 0, the coding mode of the signal for the current frame, e.g., as selected in operation 210, may be changed from the zeroth mode to the first mode (operation 230).
Otherwise, if the determination of operation 430 indicates that the coding mode of the signal in the immediately previous frame, for example, is the zeroth mode or the determination of operation 440 indicates that the history value in the first mode is the example 0, the coding mode of the signal for the current frame, e.g., as selected operation 210, would not be changed. Here, a case when the history value in the first mode is the example 0 may refer to a case when the history value in the first mode corresponds to a pre-set minimum value or a case when the signal in the immediately previous frame, for example, corresponds to a silence period and thus is reset.
FIG. 5 illustrates a coding mode determination method, according to one or more embodiments.
Referring to FIG. 5, initially, a determination is made as to whether a signal in a current frame corresponds to a silence period (operation 500). The determination of operation 500 may be performed based on the energy or the characteristic of the signal in the current frame. For example, if the energy is less than a threshold value, it may be determined that the signal in the current frame corresponds to the silence period, again noting that alternative techniques for silence period detection are available.
If the determination of operation 500 indicates that the signal in the current frame corresponds to the silence period, information and/or parameters regarding signals in one or more previous frames, which may be stored for use in setting a coding mode of the signal for the current frame, from among a plurality of signal coding modes, may be reset (operation 505).
The information or the parameters regarding the signals in the previous frames, which are reset in operation 505, may be information or parameters regarding long-term features. In operation 505, from among the long-term features, a mean value regarding short-term features of signals in a pre-set number of previous frames, and/or a history value of speech or music presence possibilities of a signal in a predetermined frame may be reset, for example.
Here, a long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. A short-term feature refers to a peculiar characteristic of each frame and may include information or parameters such as an LP-LTP gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation. In one or more embodiments, such peculiar characteristics may be selectable in implementation of the present invention.
As only an example, the long-term features include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities. From among the long-term features, an SPP may be calculated, e.g., by using the above Equation 1. In addition, the history value of the speech or music presence possibilities refers to a value obtained by applying weights to speech or music presence possibilities of signals in a predetermined number of frames and accumulating the speech or music presence possibilities. An example of a method of calculating a history value of SPPs has been representatively described above with reference to FIG. 3.
FIG. 6 illustrates a silence period and a non-silence period, according to one or more embodiments.
Referring to FIG. 6, when a first period 600, i.e., the silence period, is followed by a second period 610, i.e., the non-silence period, in order to reduce errors caused at a moment when a frame corresponding to the silence period is changed into a frame corresponding to the non-silence period, a weight of an SPP to be reflected to a history value may be gradually increased from an initial frame corresponding to a non-silence period changed from a silence period, to a predetermined frame. For example, the lowest weight may be applied to an initial frame corresponding to a non-silence period changed from a silence period, which may have the lowest accuracy. Then, a weight to be applied may be gradually increased from a subsequent frame of the initial frame and the highest weight may be applied from a predetermined frame so as to fully reflect an SPP to a history value.
Referring back to FIG. 5, after performing operation 505, a determination is made as to whether to code the signal in the current frame in a coding mode of a signal in an immediately previous frame (operation 510).
After performing operation 510, a pre-set value may be allocated to the history value of the speech or music presence possibilities of the signal in the current frame (operation 515). For example, in the example of FIG. 3, when a coding mode of a signal in an immediately previous frame is a first mode, a value x may be allocated to a history value in the first mode and a value y may be allocated to a history value in a zeroth mode. When the coding mode of the signal in the immediately previous frame is the zeroth mode, a value v may be allocated to the history value in the first mode and a value w may be allocated to the history value in the zeroth mode. Here, the values x, y, v, and w may be pre-set values.
Otherwise, if the determination in operation 500 indicates that the signal in the current frame does not correspond to the silence period, the characteristic of the signal in the current frame may be analyzed so as to extract information or a parameter regarding the signal in the current frame (operation 520). Examples of the information or the parameter regarding the signal in the current frame, which is extracted in operation 520, include short-term and long-term features, for example.
The coding mode of the signal in the current frame may be selected from among a plurality of signal coding modes based on the information or the parameter regarding the signal in the current frame, which is extracted in operation 520 (operation 525). Here, examples of the signal coding modes include a time-domain coding mode such as a CELP method and a frequency-domain coding mode such as a TCX method or an AAC method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
After performing operation 525, a determination is made as to whether to change the coding mode, selected in operation 525, by using a coding mode of a signal in one or more previous frames, and/or speech or music presence possibilities of signals in a predetermined number of previous frames and the signal in the current frame (operation 530). The speech or music presence possibilities of the signals in the previous frames and the signal in the current frame may be represented by the above-described history value of the speech or music presence possibilities. An example of operation 530 has been described in detail above with reference to FIG. 3.
If the determination of operation 530 indicates to change the coding mode selected in operation 525, the coding mode selected in operation 525 is changed (operation 535).
After performing operation 515 or operation 535, a determination is made as to whether the current frame is a last frame (operation 540).
If the determination of operation 540 indicates that the current frame is not the last frame, a subsequent frame may be received (operation 545) and operations 500 through 540 may be repeatedly performed on the subsequent frame(s).
FIG. 7 illustrates a coding mode determination apparatus, according to one or more embodiments. Herein, the term apparatus should be considered synonymous with elements of a physical system, not limited to a single enclosure or all described elements embodied in single respective enclosures in all embodiments, but rather, depending on embodiment, is open to being embodied together or separately in differing enclosures and/or locations through differing elements. As only another example, a respective apparatus/system or method could also be controlled through one or more processing elements/devices or implemented by a distributed network, noting that additional and alternative embodiments are equally available.
Referring to FIG. 7, the coding mode determination apparatus may include a silence period determination unit 700, a storage unit 710, a reset unit 720, and a coding mode determination unit 730, for example. Any of the silence period determination unit 700, the storage unit 710, the reset unit 720, and the coding mode determination unit 730 may be implemented as at least one processor or processing device.
The silence period determination unit 700 may determine whether a signal in a current frame received through an input terminal IN corresponds to a silence period. The determination by the silence period determination unit 700 may be performed based on the energy or the characteristic of the signal in the current frame. For example, if the energy is less than a threshold value, it may be determined that the signal in the current frame corresponds to the silence period, again noting that alternate silence detection techniques are available.
The storage unit 710 stores information or parameters regarding signals in one or more previous frames, which are used to select a coding mode for the signal in the current frame from among a plurality of signal coding modes. Also, the storage unit 710 may store plural coding modes for signals of a predetermined number of previous frames.
If the silence period determination unit 700 determines that the signal in the current frame corresponds to the silence period, the reset unit 720 may reset the information or the parameters regarding the signals in the previous frames, which are stored in the storage unit 710.
The information or the parameters regarding the signals in the previous frames, which may be reset by the reset unit 720, may be information or parameters regarding long-term features, for example. From among the long-term features, the reset unit 720 may reset a mean value regarding short-term features of signals in a pre-set number of previous frames, or a history value of speech or music presence possibilities of a signal in a predetermined frame.
Here, a long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. For example, long-term features include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities. A short-term feature refers to a peculiar characteristic of each frame and may include any of information or parameters such as an LP-LTP gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation, for example.
If the silence period determination unit 700 determines that the signal in the current frame corresponds to the silence period, the coding mode determination unit 730 may determine to code the signal in the current frame in a coding mode of a signal in an immediately previous frame, and the coding mode determined by the coding mode determination unit 730 may be output through an output terminal OUT.
On the other hand, if the silence period determination unit 700 determines that the signal in the current frame does not correspond to the silence period, the coding mode determination unit 730 may analyze the characteristic of the signal in the current frame so as to extract information or a parameter regarding the signal in the current frame, and select the coding mode for the signal in the current frame from among a plurality of signal coding modes based on the information or the parameters regarding the signals in the previous frames and the information or the parameter regarding the signal in the current frame. The coding mode determined by the coding mode determination unit 730 may be output through the output terminal OUT. Examples of the information or the parameter regarding the signal in the current frame, which is extracted by the coding mode determination unit 730, may include the above-described short-term and long-term features, for example. The coding mode determination unit 730 may store the information or the parameter regarding the signal in the current frame in the storage unit 710.
Here, examples of the signal coding modes include a time-domain coding mode such as a CELP method and a frequency-domain coding mode such as a TCX method or an AAC method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
FIG. 8 illustrates a coding mode determination apparatus, according to one or more embodiments.
Referring to FIG. 8, the coding mode determination apparatus may include a signal analysis unit 800, a storage unit 805, a coding mode determination unit 810, a change determination unit 820, and a mode change unit 830, for example. Any of the signal analysis unit 800, the storage unit 805, the coding mode determination unit 810, the change determination unit 820, and the mode change unit 830 may be implemented as at least one processor or processing device.
The signal analysis unit 800 may analyze the characteristic of a signal in a current frame, e.g., as received through an input terminal IN, so as to extract information or a parameter regarding the signal in the current frame. Examples of the information or the parameter extracted by the signal analysis unit 800 may include short-term and long-term features, for example. A short-term feature refers to a peculiar characteristic of each frame and may include information or parameters such as an LP-LTP gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation, for example. A long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. For example, the long-term feature may include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities, for example.
From among the long-term features, an SPP may be calculated, e.g., by using the above Equation 1. It is again noted that embodiments of the present invention are not limited to the SPP.
In addition, the history value of the speech or music presence possibilities refers to a value obtained by applying weights to speech or music presence possibilities of signals in a predetermined number of frames and accumulating the speech or music presence possibilities. An example method of calculating a history value of SPPs has been representatively described above with reference to FIG. 3.
The storage unit 805 may store information or parameters regarding signals in one or more previous frames, which can be used to select a coding mode of the signal in the current frame from among a plurality of signal coding modes. In addition, the storage unit 805 may store coding modes of signals in a predetermined number of previous frames.
The coding mode determination unit 810 may select the coding mode of the signal in the current frame from among a plurality of signal coding modes by using the information or the parameter regarding the signal in the current frame, which is extracted by the signal analysis unit 800. Here, examples of the signal coding modes include a time-domain coding mode such as a CELP method and a frequency-domain coding mode such as a TCX method or an AAC method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
The change determination unit 820 may determine whether to change the coding mode selected by the coding mode determination unit 810, by using a coding mode of a signal in a previous frame, and/or speech or music presence possibilities of signals in a predetermined number of previous frames and the signal in the current frame. The speech or music presence possibilities of the signals in the previous frames and the signal in the current frame may be represented by the above-described history value of the speech or music presence possibilities. An example operation of the change determination unit 820 has been described in detail above with reference to FIG. 3.
If the change determination unit 820 determines to change the coding mode selected by the coding mode determination unit 810, the mode change unit 830 changes the coding mode selected by the coding mode determination unit 810. The coding mode may be changed by the mode change unit 830 and further output through an output terminal OUT.
On the other hand, if the change determination unit 820 determines not to change the coding mode selected by the coding mode determination unit 810, the coding mode selected by the coding mode determination unit 810 may be output through the output terminal OUT.
FIG. 9 illustrates a coding mode determination apparatus, according to one or more embodiments.
Referring to FIG. 9, the coding mode determination apparatus may include a silence period determination unit 900, a storage unit 905, a reset unit 910, a signal analysis unit 915, a coding mode determination unit 920, a change determination unit 925, a mode change unit 930, and a smoothing unit 935, for example. Any of the silence period determination unit 900, the storage unit 905, the reset unit 910, the signal analysis unit 915, the coding mode determination unit 920, the change determination unit 925, the mode change unit 930, and the smoothing unit 935 may be implemented as at least one processor or processing device.
The silence period determination unit 900 determines whether a signal in a current frame, e.g., as received through an input terminal IN, corresponds to a silence period. The determination by the silence period determination unit 900 may be performed based on the energy or the characteristic of the signal in the current frame. For example, if the energy is less than a threshold value, it may be determined that the signal in the current frame corresponds to the silence period, again noting that alternative silence detection techniques are equally available.
The storage unit 905 may store information or parameters regarding signals for one or more previous frames, which can be used to select a coding mode of the signal for the current frame, from among a plurality of signal coding modes. In addition, the storage unit 905 may store coding modes of signals in a predetermined number of previous frames.
If the silence period determination unit 900 determines that the signal in the current frame corresponds to the silence period, the reset unit 910 may reset the information or the parameters regarding the signals in the previous frames, e.g., which may be stored in the storage unit 905.
The information or the parameters regarding the signals in the previous frames, which may be reset by the reset unit 910, may be information or parameters regarding long-term features, for example. From among the long-term features, the reset unit 910 may reset a mean value regarding short-term features of signals in a pre-set number of previous frames, or a history value of speech or music presence possibilities of a signal in a predetermined frame, for example.
Here, a long-term feature refers to information obtained by analyzing transitions of short-term features of signals in one or more previous frames. A short-term feature refers to a peculiar characteristic of each frame and may include information or parameters such as an LP-LTP gain, a spectrum tilt, a zero crossing rate, and a spectrum auto-correlation.
For example, the long-term features include a mean value regarding short-term features of signals in a pre-set number of previous frames, a speech or music presence possibility of a signal in a predetermined frame, and a history value of speech or music presence possibilities. From among the long-term features, an SPP may be calculated, e.g., by using the above Equation 1. In addition, the history value of the speech or music presence possibilities refers to a value obtained by applying weights to speech or music presence possibilities of signals in a predetermined number of frames and accumulating the speech or music presence possibilities. An example method of calculating a history value of SPPs has been representatively described above with reference to FIG. 3.
If the silence period determination unit 900 determines that the signal in the current frame does not correspond to the silence period, the signal analysis unit 915 analyzes the characteristic of the signal in the current frame so as to extract information or a parameter regarding the signal in the current frame. Examples of the information or the parameter extracted by the signal analysis unit 915 include short-term and long-term features, for example.
However, if the silence period determination unit 900 determines that the signal in the current frame corresponds to the silence period, the signal analysis unit 915 allocates a pre-set value to the history value of the speech or music presence possibilities of the signal in the current frame. For example, as noted above regarding FIG. 3, if a coding mode of a signal in an immediately previous frame is a first mode, a value x may be allocated to a history value in the first mode and a value y may be allocated to a history value in a zeroth mode. If the coding mode of the signal in the immediately previous frame is the zeroth mode, a value v may be allocated to the history value in the first mode and a value w may be allocated to the history value in the zeroth mode. Here, the values x, y, v, and w may be pre-set values.
If the silence period determination unit 900 determines that the signal in the current frame does not correspond to the silence period, the coding mode of the signal for the current frame may be selected from among a plurality of signal coding modes based on the information or the parameter regarding the signal in the current frame, which is extracted by the signal analysis unit 915. Here, examples of the signal coding modes include a time-domain coding mode such as a CELP method and a frequency-domain coding mode such as a TCX method or an AAC method. The examples of the signal coding modes may also include a speech coding mode and a music coding mode. Here, additional and/or alternative coding modes may be available, and embodiments are not limited to such indicated coding modes.
However, if the silence period determination unit 900 determines that the signal in the current frame corresponds to the silence period, the coding mode determination unit 920 may determine to code the signal in the current frame in a coding mode of a signal in an immediately previous frame.
The change determination unit 925 may determine whether to change the coding mode selected by the coding mode determination unit 920, by using a coding mode of a signal in a previous frame, and/or speech or music presence possibilities of signals in a predetermined number of previous frames and the signal in the current frame. The speech or music presence possibilities of the signals in the previous frames and the signal in the current frame may be represented by the above-described history value of the speech or music presence possibilities. An example operation of the change determination unit 925 has been described in detail above with reference to FIG. 3.
If the change determination unit 925 determines to change the coding mode selected by the coding mode determination unit 920, the mode change unit 930 changes the coding mode selected by the coding mode determination unit 920, and the coding mode changed by the mode change unit 930 is output through an output terminal OUT.
However, otherwise, if the change determination unit 925 determines not to change the coding mode determined by the coding mode determination unit 920, the coding mode selected by the coding mode determination unit 920 may be output through the output terminal OUT.
If, as illustrated in FIG. 6, the first period 600, i.e., a silence period, is followed by the second period 610, i.e., a non-silence period, in order to reduce errors caused at a moment when a frame corresponding to the silence period is changed into a frame corresponding to the non-silence period, the smoothing unit 935 may gradually increase a weight of an SPP to be reflected to a history value from an initial frame corresponding to a non-silence period changed from a silence period, to a predetermined frame. For example, the lowest weight may be applied to an initial frame corresponding to a non-silence period changed from a silence period, which may have the lowest accuracy. Then, a weight to be applied may be gradually increased from a subsequent frame of the initial frame and the highest weight may be applied from a predetermined frame so as to fully reflect an SPP to a history value.
In addition to the above described embodiments, one or more embodiments may also be implemented through computer readable code/instructions in/on a medium, e.g., a computer readable medium, to control at least one processing device to implement any above described embodiment. The medium can correspond to any defined, measurable, and tangible structure permitting the storing and/or transmission of the computer readable code.
The media may also include, e.g., in combination with the computer readable code, data files, data structures, and the like. Examples of computer-readable media include magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD ROM disks and DVDs; magneto-optical media such as optical disks; and hardware devices that are specially configured to store and perform program instructions, such as read-only memory (ROM), random access memory (RAM), flash memory, and the like. Examples of computer readable code include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter, for example. The media may also be a distributed network, so that the computer readable code is stored and executed in a distributed fashion. Still further, as only an example, the processing element could include a processor or a computer processor, and processing elements may be distributed and/or included in a single device.
While aspects of the present invention has been particularly shown and described with reference to differing embodiments thereof, it should be understood that these exemplary embodiments should be considered in a descriptive sense only and not for purposes of limitation. Descriptions of features or aspects within each embodiment should typically be considered as available for other similar features or aspects in the remaining embodiments.
Thus, although a few embodiments have been shown and described, with additional embodiments being equally available, it would be appreciated by those skilled in the art that changes may be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.

## Claims

1. A coding mode determination method comprising:
determining a coding mode of a current frame, wherein the coding mode of the current frame is one of a music coding mode and a speech coding mode;
obtaining signal characteristics obtained from a plurality of frames;
determining, performed by at least one processing device, whether to change the determined coding mode of the current frame, based on the signal characteristics and a parameter associated with frequent switching between the music coding mode and the speech coding mode;
changing the determined coding mode of the current frame to another mode which is one of the music coding mode and the speech coding mode, when it is determined to change the determined coding mode of the current frame;
encoding the current frame, according to either the determined coding mode when it is determined not to change the determined coding mode of the current frame or the corrected coding mode when it is determined to change the determined coding mode of the current frame; and
transmitting a bitstream including a result of the encoding, for reproduction of music or speech.

2. The method of claim 1, wherein the determining of whether to change the determined coding mode comprises:
applying and accumulating a history, related to the signal characteristics; and
determining whether to change the determined coding mode based on the accumulated history.

3. The method of claim 2, wherein the determining of whether to change the determined coding mode by using the accumulated history comprises determining whether to change the determined coding mode by comparing the accumulated history to a pre-set value.

4. The method of claim 1 further comprising:
determining the coding mode of the current frame as a coding mode of a previous frame, when the current frame corresponds to a silence period.

5. The method of claim 4 further comprising:
resetting parameters related to previous frames, when the current frame corresponds to the silence period.

6. A coding mode determination apparatus comprising:
at least one processor configured to:
determine a coding mode of a current frame, wherein the coding mode of the current frame is one of a music coding mode and a speech coding mode;
obtain signal characteristics obtained from a plurality of frames;
determine whether to change the determined coding mode of the current frame, based on the signal characteristics and a parameter associated with frequent switching between the music coding mode and the speech coding mode;
change the determined coding mode of the current frame to another mode which is one of the music coding mode and the speech coding mode, when it is determined to change the determined coding mode of the current frame;
encode the current frame, according to either the determined coding mode when it is determined not to change the determined coding mode of the current frame or the corrected coding mode when it is determined to change the determined coding mode of the current frame; and
transmit a bitstream including a result of the encoding, for reproduction of music or speech.

7. The apparatus of claim 6, wherein the change determination unit applies and accumulates a history, related to the signal characteristics, and determines whether to change the determined coding mode based on the accumulated history.

8. A coding mode determination method comprising:
determining a coding mode of a current frame, wherein the coding mode of the current frame is one of a music coding mode and a speech coding mode;
determining, performed by at least one processing device, whether to change the determined coding mode of the current frame, based on at least one of coding modes and signal characteristics, obtained from a plurality of frames, and a parameter associated with frequent switching between the music coding mode and the speech coding mode;
changing the determined coding mode of the current frame to another mode which is one of the music coding mode and the speech coding mode, when it is determined to change the determined coding mode of the current frame;
encoding the current frame, according to either the determined coding mode when it is determined not to change the determined coding mode of the current frame or the corrected coding mode when it is determined to change the determined coding mode of the current frame; and
transmitting a bitstream including a result of the encoding, for reproduction of music or speech.

9. The method of claim 8 further comprising:
determining the coding mode of the current frame as a coding mode of a previous frame, when the current frame corresponds to a silence period.

10. The method of claim 9 further comprising:
resetting parameters related to previous frames, when the current frame corresponds to the silence period.