A method for calculating a downmixed signal and a residual signal, comprising: obtaining an initial downmixed signal and an initial residual signal of a subband corresponding to a preset frequency band in a current frame of an audio signal, wherein the audio signal is a stereo signal; characterised by determining whether a first target frame of the audio signal is a switching frame, wherein the first target frame is the current frame; wherein when encoded statuses of residual signals of two adjacent frames are inconsistent, a latter frame of the two frames is referred as a switching frame; and if the first target frame is a switching frame, calculating, based on a switch fade-in/fade-out factor of a second target frame, the initial downmixed signal, and the initial residual signal, a to-be-encoded downmixed signal and a to-be-encoded residual signal of the subband corresponding to the preset frequency band in the current frame, wherein the second target frame is a previous frame of the current frame, and the switch fade-in/fade-out factor of the second target frame is determined based on a residual signal coding parameter of the second target frame and at least one of an inter-frame energy fluctuation parameter or an inter-frame amplitude fluctuation parameter of the second target frame; and the residual signal coding parameter of the second target frame is used to represent an energy relationship between a downmixed signal and a residual signal of the second target frame, and the inter-frame energy fluctuation parameter or the inter-frame amplitude fluctuation parameter of the second target frame is used to represent an energy or amplitude relationship between the second target frame and a frame previous to the second target frame. obtaining an initial downmixed signal and an initial residual signal of a subband corresponding to a preset frequency band in a current frame of an audio signal, wherein the audio signal is a stereo signal; characterised by determining whether a first target frame of the audio signal is a switching frame, wherein the first target frame is the current frame; wherein when encoded statuses of residual signals of two adjacent frames are inconsistent, a latter frame of the two frames is referred as a switching frame; and if the first target frame is a switching frame, calculating, based on a switch fade-in/fade-out factor of a second target frame, the initial downmixed signal, and the initial residual signal, a to-be-encoded downmixed signal and a to-be-encoded residual signal of the subband corresponding to the preset frequency band in the current frame, wherein the second target frame is a previous frame of the current frame, and the switch fade-in/fade-out factor of the second target frame is determined based on a residual signal coding parameter of the second target frame and at least one of an inter-frame energy fluctuation parameter or an inter-frame amplitude fluctuation parameter of the second target frame; and the residual signal coding parameter of the second target frame is used to represent an energy relationship between a downmixed signal and a residual signal of the second target frame, and the inter-frame energy fluctuation parameter or the inter-frame amplitude fluctuation parameter of the second target frame is used to represent an energy or amplitude relationship between the second target frame and a frame previous to the second target frame. <EOS>