A video coding device (AA) that allows adaptive filtering within a coding loop and which is configured to apply a filter to each of a plurality of areas, each area including one or more pixels, the video coding device (AA) comprising: pixel value feature amount calculation means for deriving a feature amount of each area of a plurality of areas in a decoded image, the feature amount of an area being an average value of pixel value gradients of the area; dynamic threshold determination means for determining, for each area, a respective threshold based on the feature amount of each area derived by the pixel value feature amount calculation means ; threshold processing and sorting means for comparing the feature amount of each area derived by the pixel value feature amount calculation means with the respective threshold determined by the dynamic threshold determination means , and sorting each area based on the comparison results; and filtering means for applying a filter to each area in dependence on the sorting result of the respective area by the threshold processing and sorting means , the filter being adapted for each area based on the respective comparison result; wherein the dynamic threshold determination means includes: characteristic bin detection means for deriving a histogram of the feature amounts of the plurality of areas derived by the pixel value feature amount calculation means , and detecting bins in which frequencies are concentrated from among the bins of the derived histogram; and threshold determination means for deriving two bins that are adjacent to each other among the bins detected by the characteristic bin detection means, and determining a value between the two derived bins as the threshold for the two bins. pixel value feature amount calculation means for deriving a feature amount of each area of a plurality of areas in a decoded image, the feature amount of an area being an average value of pixel value gradients of the area; dynamic threshold determination means for determining, for each area, a respective threshold based on the feature amount of each area derived by the pixel value feature amount calculation means ; threshold processing and sorting means for comparing the feature amount of each area derived by the pixel value feature amount calculation means with the respective threshold determined by the dynamic threshold determination means , and sorting each area based on the comparison results; and filtering means for applying a filter to each area in dependence on the sorting result of the respective area by the threshold processing and sorting means , the filter being adapted for each area based on the respective comparison result; wherein the dynamic threshold determination means includes: characteristic bin detection means for deriving a histogram of the feature amounts of the plurality of areas derived by the pixel value feature amount calculation means , and detecting bins in which frequencies are concentrated from among the bins of the derived histogram; and threshold determination means for deriving two bins that are adjacent to each other among the bins detected by the characteristic bin detection means, and determining a value between the two derived bins as the threshold for the two bins. characteristic bin detection means for deriving a histogram of the feature amounts of the plurality of areas derived by the pixel value feature amount calculation means , and detecting bins in which frequencies are concentrated from among the bins of the derived histogram; and threshold determination means for deriving two bins that are adjacent to each other among the bins detected by the characteristic bin detection means, and determining a value between the two derived bins as the threshold for the two bins. <EOS>