Next, adaptive offset filter setting operation will be described below. The adaptive offset filter 35 determines whether or not the SAO process for a slice as a target to be processed is to be turned on. In case a slice as a target to be processed is either an I slice or a P slice, the adaptive offset filter 35 turns on the SAO process. In case a slice as a target to be processed is a B slice, the adaptive offset filter 35 turns on the SAO process when the number of modes in a slice preceding the B slice is equal to or larger than the predetermined threshold value Ths, and turns off the SAO process when the number of modes is smaller than the threshold value Ths. Moreover, the adaptive offset filter 35 may turn on or off the SAO process according to an instruction from the user or the like.
In case the adaptive offset filter 35 turns on the SAO process, the adaptive offset filter 35 performs adaptive offset filter setting operation illustrated in
In step ST21, the adaptive offset filter determines whether or not a TU in the transformation skip mode (TS mode) is intermingled. The adaptive offset filter 35 determines whether or not a TU in the transformation skip mode is intermingled in a LCU on the basis of the transformation skip information from the transformation skip controller 44. In case a TU to be orthogonally transformed and a TU in the transformation skip mode are intermingled in a LCU, the adaptive offset filter 35 goes to step ST22. In case they are not intermingled in a LCU, the adaptive offset filter 35 goes to step ST26.