| CPC H04N 19/159 (2014.11) [H04N 19/172 (2014.11); H04N 19/184 (2014.11)] | 18 Claims |

|
1. An image encoding method, performed by a computer device, comprising:
obtaining a first image frame in a video stream;
encoding the first image frame into a first non-instantaneous decoding refresh (non-IDR) frame;
determining whether the first non-IDR frame indicates that a scene switch occurs; and
obtaining a preset image frame sequence to which the first image frame belongs;
determining whether there is an image frame that is encoded into an IDR frame based on the scene switch in the preset image frame sequence;
determining, according to the first non-IDR frame based on there not being the image frame that is encoded into the IDR frame, whether the scene switch occurs; and
encoding a next image frame of the first image frame into an instantaneous decoding refresh (IDR) frame based on a determination that the first non-IDR frame indicates that the scene switch occurs.
|