图像处理技术!
返回

x264 的 x264_image_properties_t 结构

2020-10-13 4421 0

typedef struct x264_image_properties_t
{
    /* All arrays of data here are ordered as follows:
     * each array contains one offset per macroblock, in raster scan order.  In interlaced
     * mode, top-field MBs and bottom-field MBs are interleaved at the row level.
     * Macroblocks are 16x16 blocks of pixels (with respect to the luma plane).  For the
     * purposes of calculating the number of macroblocks, width and height are rounded up to
     * the nearest 16.  If in interlaced mode, height is rounded up to the nearest 32 instead. */
     这里的所有数据数组排序如下:
     每个数组包含每个宏块的一个偏移量,按光栅扫描顺序排列。 
     在交错模式下,在行级别上交错顶场MBS和底场MBS。
     宏块是16x16块像素(相对于Luma平面)。
     为了计算宏块的数量,宽度和高度被舍入到最近的16。
     如果在交错模式下,高度被舍入到最近的32。
    /* In: an array of quantizer offsets to be applied to this image during encoding.
     *     These are added on top of the decisions made by x264.
     *     Offsets can be fractional; they are added before QPs are rounded to integer.
     *     Adaptive quantization must be enabled to use this feature.  Behavior if quant
     *     offsets differ between encoding passes is undefined. */
     输入:在编码过程中要应用于此图像的量化器偏移量数组。
     这些都是在x264所做决定的基础上添加的。
     偏移量可以是分数,它们是在QPS四舍五入到整数之前添加的。
     必须启用自适应量化来使用此特性。 如果编码传递之间的量化偏移不同,则行为是未定义的。
    float *quant_offsets;
    
    /* In: optional callback to free quant_offsets when used.
     *     Useful if one wants to use a different quant_offset array for each frame. */
    输入:可选的回调用于释放 quant_offsets。
    如果您想为每个帧使用不同的quant_offset数组,则非常有用。     
    void (*quant_offsets_free)( void* );

    /* In: optional array of flags for each macroblock.
     *     Allows specifying additional information for the encoder such as which macroblocks
     *     remain unchanged.  Usable flags are listed below.
     *     x264_param_t.analyse.b_mb_info must be set to use this, since x264 needs to track
     *     extra data internally to make full use of this information.
     *
     * Out: if b_mb_info_update is set, x264 will update this array as a result of encoding.
     *
     *      For "MBINFO_CONSTANT", it will remove this flag on any macroblock whose decoded
     *      pixels have changed.  This can be useful for e.g. noting which areas of the
     *      frame need to actually be blitted. Note: this intentionally ignores the effects
     *      of deblocking for the current frame, which should be fine unless one needs exact
     *      pixel-perfect accuracy.
     *
     *      Results for MBINFO_CONSTANT are currently only set for P-frames, and are not
     *      guaranteed to enumerate all blocks which haven't changed.  (There may be false
     *      negatives, but no false positives.)
     */
     输入:为每个宏块可选的标志数组。
     允许为编码器指定其他信息,例如哪些宏块保持不变。 下面列出了可用的标志。
     x264_param_t.analyse.b_mb_info必须设置为使用此功能,因为x264需要在内部跟踪额外的数据,以充分利用这些信息。
     
     输出:如果设置了b_mb_info_update,x264将由于编码而更新此数组。
     对于“MBINFO_CONSTANT”,它将在任何解码像素已更改的宏块上删除此标志。 这可能对例如有用。 注意框架的哪些区域实际上需要被模糊。 注意:这故意忽略了当前帧的去阻塞效果,这应该是好的,除非一个人需要精确的像素完美的精度。
     MBINFO_CONSTANT的结果目前只为P帧设置,不能保证枚举所有未更改的块。 (可能有假阴性,但没有假阳性。 )
     
    uint8_t *mb_info;
    /* In: optional callback to free mb_info when used. */
    输入:可选的回调用于释放 mb_info。
    void (*mb_info_free)( void* );

    /* The macroblock is constant and remains unchanged from the previous frame. */
    宏块是恒定的,与前一个帧保持不变。
    #define X264_MBINFO_CONSTANT   (1U<<0)
    /* More flags may be added in the future. */
    未来可能会增加更多的标记。
    
    /* Out: SSIM of the the frame luma (if x264_param_t.b_ssim is set) */
    double f_ssim;
    /* Out: Average PSNR of the frame (if x264_param_t.b_psnr is set) */
    double f_psnr_avg;
    /* Out: PSNR of Y, U, and V (if x264_param_t.b_psnr is set) */
    double f_psnr[3];

    /* Out: Average effective CRF of the encoded frame */
    输出:编码帧的平均有效CRF
    double f_crf_avg;
} x264_image_properties_t;


顶部