A method for generating an output signal that comprises: receiving samples of a source signal having spectral content, wherein the source signal is an audio signal or a video signal; applying a primary transform to overlapping segments of the samples to generate a plurality of sets of spectral coefficients, wherein the primary transform is a Modified Discrete Cosine Transform and each set of spectral coefficients has time-domain aliasing artifacts and represents the spectral content of a respective source signal segment for a set of frequencies; obtaining a plurality of spectral coefficients representing the same frequency in the set of frequencies from the plurality of sets of spectral coefficients and assembling the plurality of spectral coefficients into one or more blocks of spectral coefficients, wherein the number of spectral coefficients that are assembled in each of the one or more blocks is adapted in response to a block-length control signal; applying a secondary transform to the one or more blocks of spectral coefficients to generate one or more sets of hybrid-transform coefficients, wherein the secondary transform is a Discrete Cosine Transform that is applied to blocks of spectral coefficients that do not overlap one another and the length of the secondary transform that is applied to each of the one or more blocks of spectral coefficients is adapted in response to the block-length control signal; generating encoded information by quantizing the one or more sets of hybrid-transform coefficients; and assembling the encoded information representing the one or more sets of hybrid-transform coefficients and the block-length control signal into the output signal, wherein the block-length control signal is obtained by: calculating differences in magnitude between adjacent spectral coefficients and identifying the longest block of adjacent spectral coefficients in which the average difference is less than a threshold; or adding magnitude differences for a band of spectral coefficients and identifying the longest block in which the average difference across the band is less than a threshold. receiving samples of a source signal having spectral content, wherein the source signal is an audio signal or a video signal; applying a primary transform to overlapping segments of the samples to generate a plurality of sets of spectral coefficients, wherein the primary transform is a Modified Discrete Cosine Transform and each set of spectral coefficients has time-domain aliasing artifacts and represents the spectral content of a respective source signal segment for a set of frequencies; obtaining a plurality of spectral coefficients representing the same frequency in the set of frequencies from the plurality of sets of spectral coefficients and assembling the plurality of spectral coefficients into one or more blocks of spectral coefficients, wherein the number of spectral coefficients that are assembled in each of the one or more blocks is adapted in response to a block-length control signal; applying a secondary transform to the one or more blocks of spectral coefficients to generate one or more sets of hybrid-transform coefficients, wherein the secondary transform is a Discrete Cosine Transform that is applied to blocks of spectral coefficients that do not overlap one another and the length of the secondary transform that is applied to each of the one or more blocks of spectral coefficients is adapted in response to the block-length control signal; generating encoded information by quantizing the one or more sets of hybrid-transform coefficients; and assembling the encoded information representing the one or more sets of hybrid-transform coefficients and the block-length control signal into the output signal, wherein the block-length control signal is obtained by: calculating differences in magnitude between adjacent spectral coefficients and identifying the longest block of adjacent spectral coefficients in which the average difference is less than a threshold; or adding magnitude differences for a band of spectral coefficients and identifying the longest block in which the average difference across the band is less than a threshold. calculating differences in magnitude between adjacent spectral coefficients and identifying the longest block of adjacent spectral coefficients in which the average difference is less than a threshold; or adding magnitude differences for a band of spectral coefficients and identifying the longest block in which the average difference across the band is less than a threshold.