A method of managing a decoded picture buffer, DPB, for a video encoding or decoding system, wherein the video encoding or decoding system uses coding modes including an Inter prediction mode and an Intra Block Copy, IntraBC, mode, the method comprising: determining whether the IntraBC mode is used for a current picture, wherein decoded data of the current picture is used as reference data for the current picture if the current picture is coded using the IntraBC mode; allocating a maximum allowed number of decoded pictures in the DPB based on whether the IntraBC mode is used for the current picture; and encoding or decoding the current picture using decoded pictures stored in the DPB as reference data, wherein a total number of decoded pictures in the DPB is equal to or less than the maximum allowed number of decoded pictures in the DPB; characterized in that whether the IntraBC mode is used for the current picture is indicated by a syntax flag or a variable, and a value of the syntax flag or the variable is related to whether two versions of a decoded current picture, corresponding to the decoded current picture prior to and after loop filtering, need to be stored; wherein the method further comprises emptying one or more decoded pictures stored in the DPB when one or more conditions are true, wherein said one or more conditions include one condition corresponding to the total number of decoded pictures in the DPB being greater than or equal to the value of a syntax element reduced by the minimum of: the value of the syntax flag or the variable, and the value of the syntax element, wherein the total number of decoded pictures in the DPB does not count any version of the two versions of the decoded current picture, the value of the syntax flag or the variable is 1 if the two versions of the decoded current picture need to be stored and is 0 otherwise, and the syntax element indicates the maximum allowed number of decoded pictures in the DPB minus 1. determining whether the IntraBC mode is used for a current picture, wherein decoded data of the current picture is used as reference data for the current picture if the current picture is coded using the IntraBC mode; allocating a maximum allowed number of decoded pictures in the DPB based on whether the IntraBC mode is used for the current picture; and encoding or decoding the current picture using decoded pictures stored in the DPB as reference data, wherein a total number of decoded pictures in the DPB is equal to or less than the maximum allowed number of decoded pictures in the DPB; characterized in that whether the IntraBC mode is used for the current picture is indicated by a syntax flag or a variable, and a value of the syntax flag or the variable is related to whether two versions of a decoded current picture, corresponding to the decoded current picture prior to and after loop filtering, need to be stored; wherein the method further comprises emptying one or more decoded pictures stored in the DPB when one or more conditions are true, wherein said one or more conditions include one condition corresponding to the total number of decoded pictures in the DPB being greater than or equal to the value of a syntax element reduced by the minimum of: the value of the syntax flag or the variable, and the value of the syntax element, wherein the total number of decoded pictures in the DPB does not count any version of the two versions of the decoded current picture, the value of the syntax flag or the variable is 1 if the two versions of the decoded current picture need to be stored and is 0 otherwise, and the syntax element indicates the maximum allowed number of decoded pictures in the DPB minus 1.