The invention provides an intra-frame and inter-frame
mode selection method and related equipment, and relates to the technical field of video coding and decoding, video data to be coded are input into a video codec, and the video data to be coded comprise a plurality of video frames; respectively judging each video frame to obtain a judgment result; selecting an optimal coding mode according to a judgment result; when the judgment result is the I frame or the first P frame or the B frame, selecting an optimal coding mode through a conventional
mode selection mode; when the judgment result is that the video frame is not the I frame or the first P frame or the B frame, classifying all coding
modes according to known coding information of the video frame to obtain classification results, and selecting an optimal coding mode from the classification results; the number of
modes needing to be traversed is reduced, so that the execution efficiency of coding
mode selection is improved, and the
time overhead of a video codec on mode selection is reduced.