Disclosed are an encoding device and a decoding device, which include a CNN-based in-loop filter. The encoding device according to one embodiment comprises: a filtering unit for generating filtering information by filtering a residual image corresponding to a difference between an original image and a prediction image; an inverse filtering unit for generating inverse filtering information by inversely filtering the filtering information; a prediction unit for generating the prediction image on the basis of the original image and reconstruction information; a CNN-based in-loop filter for receiving the inverse filtering information and the prediction image so as to output the reconstruction information; and an encoding unit for performing encoding on the basis of the filtering information and information of the prediction image.