A method of encoding a video segment using geometric primitives, comprising: (S910) encoding a number of the geometric primitives to be used for a video segment; (S920) encoding type information and an additional parameter for each of the geometric primitives; if the type information is different from a default type, encoding additional parameters of a distance-to-weight function to be used for the corresponding geometric primitive, wherein the additional parameters of the distance-to-weight function to be used include a scale parameter (μ) and a change parameter (η); (S930) calculating an edge weight for each of the edges of a graph-based representation of a target block within the video segment based on a distance-to-weight function; and (S940) encoding the pixel values in the target block based on the edge weight of the graph-based representation of the target block, wherein the calculating step further includes: (S1010) calculating the minimum distance for an edge in a graph-based representation of a target block, wherein the minimum distance indicates the minimum distance from a center of the edge to each of the geometric primitives; and (S1020) applying a distance-to-weight function to the minimum distance, wherein the distance-to-weight function is defined as: φ d μ η = 2 − μd η , wherein d indicates the minimum distance, μ indicates the scale parameter and η indicates the change parameter. (S910) encoding a number of the geometric primitives to be used for a video segment; (S920) encoding type information and an additional parameter for each of the geometric primitives; if the type information is different from a default type, encoding additional parameters of a distance-to-weight function to be used for the corresponding geometric primitive, wherein the additional parameters of the distance-to-weight function to be used include a scale parameter (μ) and a change parameter (η); (S930) calculating an edge weight for each of the edges of a graph-based representation of a target block within the video segment based on a distance-to-weight function; and (S940) encoding the pixel values in the target block based on the edge weight of the graph-based representation of the target block, wherein the calculating step further includes: (S1010) calculating the minimum distance for an edge in a graph-based representation of a target block, wherein the minimum distance indicates the minimum distance from a center of the edge to each of the geometric primitives; and (S1020) applying a distance-to-weight function to the minimum distance, wherein the distance-to-weight function is defined as: φ d μ η = 2 − μd η , wherein d indicates the minimum distance, μ indicates the scale parameter and η indicates the change parameter. (S1010) calculating the minimum distance for an edge in a graph-based representation of a target block, wherein the minimum distance indicates the minimum distance from a center of the edge to each of the geometric primitives; and (S1020) applying a distance-to-weight function to the minimum distance, wherein the distance-to-weight function is defined as: φ d μ η = 2 − μd η , wherein d indicates the minimum distance, μ indicates the scale parameter and η indicates the change parameter. <EOS>