⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 anyqv.pas

📁 音视频控件SunAM-V1.0 音视频控件SunAM-V1.0 音视频控件SunAM-V1.0 音视频控件SunAM-V1.0
💻 PAS
📖 第 1 页 / 共 3 页
字号:
  xvid_plg_info_t = packed record
    version: Integer;
    flags: Integer;             // [in:opt] plugin flags
  end;

  xvid_plg_create_t = packed record
    version: Integer;
    num_zones: Integer;         // [out]
    zones: PXVID_ENC_ZONE_T;    // [out]

    width: Integer;             // [out]
    height: Integer;            // [out]
    mb_width: Integer;          // [out]
    mb_height: Integer;         // [out]
    fincr: Integer;             // [out]
    fbase: Integer;             // [out]

    param: Pointer;             // [out]
  end;

  xvid_plg_destroy_t = packed record
    version: Integer;
    num_frames: Integer;        // [out] total frame encoded
  end;

  xvid_plg_data_t = packed record
    version: Integer;
    zone: PXVID_ENC_ZONE_T;     // [out] current zone

    width: Integer;             // [out]
    height: Integer;            // [out]
    mb_width: Integer;          // [out]
    mb_height: Integer;         // [out]
    fincr: Integer;             // [out]
    fbase: Integer;             // [out]

    min_quant: Array[0..3-1] of Integer;     // [out]
    max_quant: Array[0..3-1] of Integer;     // [out]

    reference: XVID_IMAGE_T;    // [out] -> [out]
    current: XVID_IMAGE_T;      // [out] -> [in,out]
    original: XVID_IMAGE_T;     // [out] after: points the original (uncompressed) copy of the current frame
    frame_num: Integer;         // [out] frame number

    _type: Integer;             // [in,out]
    quant: Integer;             // [in,out]

    dquant: PInteger;           // [in,out] pointer to diff quantizer table
    dquant_stride: Integer;     // [in,out] diff quantizer stride

    vop_flags: Integer;         // [in,out]
    vol_flags: Integer;         // [in,out]
    motion_flags: Integer;      // [in,out]

// Deprecated, use the stats field instead. }
// Will disapear before 1.0 }
    length: Integer;            // [out] after: length of encoded frame
    kblks: Integer;             // [out] number of blocks compressed as Intra
    mblks: Integer;             // [out] number of blocks compressed as Inter
    ublks: Integer;             // [out] number of blocks marked not_coded
    sse_y: Integer;             // [out] Y plane's sse
    sse_u: Integer;             // [out] U plane's sse
    sse_v: Integer;             // [out] V plane's sse
// End of duplicated data, kept only for binary compatibility*/ }

    bquant_ratio: Integer;      // [in]
    bquant_offset: Integer;     // [in]

    stats: XVID_ENC_STATS_T;    // [out] frame statistics
  end;

//****************************************************************************
{-xvid plugin system -- external }

{-the application passes xvid an array of "xvid_plugin_t" at XVID_ENC_CREATE. the array }
{-indicates the plugin function pointer and plugin-specific data. }
{-xvidcore handles the rest. example: }

{-xvid_enc_create_t create; }
{-xvid_enc_plugin_t plugins[2]; }

{-plugins[0].func = xvid_psnr_func; }
{-plugins[0].param = NULL; }
{-plugins[1].func = xvid_cbr_func; }
{-plugins[1].param =  and cbr_data; }

{-create.num_plugins = 2; }
{-create.plugins = plugins; }

//****************************************************************************

type
  XVID_PLUGIN_FUNC = function(HANDLE: pointer; OPT: Integer; PARAM1, PARAM2: Pointer):Integer;

  Pxvid_enc_plugin_t = ^xvid_enc_plugin_t;
  xvid_enc_plugin_t = packed record
    func: XVID_PLUGIN_FUNC;
    param: Pointer;
  end;

{ single-pass rate control }
{ two-pass rate control: first pass }
{ two-pass rate control: second pass }

{ lumimasking }

{ write psnr values to stdout }
{ dump before and after yuvpgms }


{ single pass rate control }
{ CBR and Constant quantizer modes }
type
  xvid_plugin_single_t = packed record
    version: Integer;
    bitrate: Integer;                 // [in] bits per second
    reaction_delay_factor: Integer;   // [in]
    averaging_period: Integer;        // [in]
    buffer: Integer;                  // [in]
  end;

  xvid_plugin_2pass1_t = packed record
    version: Integer;
    filename: PChar;
  end;


const
  XVID_PAYBACK_BIAS = 0; // payback with bias
  XVID_PAYBACK_PROP = 1; // payback proportionally

type
  xvid_plugin_2pass2_t = packed record
    version: Integer;
    bitrate: Integer;                    // [in] bits per second
    filename: PChar;                     // [in] first pass stats filename

    keyframe_boost: Integer;             // [in] keyframe boost percentage: [0..100]
    curve_compression_high: Integer;     // [in] percentage of compression performed on the high part of the curve (above average) }
    curve_compression_low: Integer;      // [in] percentage of compression performed on the low part of the curve (below average) }
    overflow_control_strength: Integer;  // [in] Payback delay expressed in number of frames }
    max_overflow_improvement: Integer;   // [in] percentage of allowed range for a frame that gets bigger because of overflow bonus }
    max_overflow_degradation: Integer;   // [in] percentage of allowed range for a frame that gets smaller because of overflow penalty }

    kfreduction: Integer;                // [in] maximum bitrate reduction applied to an iframe under the kfthreshold distance limit }
    kfthreshold: Integer;                // [in] if an iframe is closer to the next iframe than this distance, a quantity of bits }
                                         // is substracted from its bit allocation. The reduction is computed as multiples of
                                         // kfreduction/kthreshold. It reaches kfreduction when the distance == kfthreshold,
                                         // 0 for 1<distance<kfthreshold }

    container_frame_overhead: Integer;   // [in] How many bytes the controller has to compensate per frame due to container format overhead }
  end;

//****************************************************************************
// ENCODER API
//****************************************************************************

//----------------------------------------------------------------------------
// Encoder operations
//----------------------------------------------------------------------------
const
  XVID_ENC_CREATE = 0;    // create encoder instance; returns 0 on success
  XVID_ENC_DESTROY = 1;   // destroy encoder instance; returns 0 on success
  XVID_ENC_ENCODE = 2;    //* encode a frame: returns number of ouput bytes
                          // * 0 means this frame should not be written (ie. encoder lag)
//----------------------------------------------------------------------------
// Encoder entry point
//----------------------------------------------------------------------------
type
  xvid_encore = function(handle: Pointer;
                        opt: Integer;
                        param1: Pointer;
                        param2: Pointer): Integer; cdecl;

// Quick API reference
//
// XVID_ENC_CREATE operation
// - handle: ignored
// - opt: XVID_ENC_CREATE
// - param1: address of a xvid_enc_create_t structure
// - param2: ignored
//
// XVID_ENC_ENCODE operation
// - handle: an instance returned by a CREATE op
// - opt: XVID_ENC_ENCODE
// - param1: address of a xvid_enc_frame_t structure
// - param2: address of a xvid_enc_stats_t structure (optional)
// its return value is asynchronous to what is written to the buffer
// depending on the delay introduced by bvop use. It's display
// ordered.
//
// XVID_ENC_DESTROY operation
// - handle: an instance returned by a CREATE op
// - opt: XVID_ENC_DESTROY
// - param1: ignored
// - param2: ignored


//----------------------------------------------------------------------------
// "Global" flags
//
// These flags are used for xvid_enc_create_t->global field during instance
// creation (operation XVID_ENC_CREATE)
//----------------------------------------------------------------------------

const
  XVID_GLOBAL_PACKED = (1 shl 0);             // packed bitstream
  XVID_GLOBAL_CLOSED_GOP = (1 shl 1);         // closed_gop: was DX50BVOP dx50 bvop compatibility
  XVID_GLOBAL_EXTRASTATS_ENABLE = (1 shl 2);
{$IFDEF 0}
  XVID_GLOBAL_VOL_AT_IVOP = (1 shl 3);        // write vol at every ivop: WIN32/divx compatibility
  XVID_GLOBAL_FORCE_VOL = (1 shl 4);          // when vol-based parameters are changed, insert an ivop NOT recommended
{$ENDIF}

//----------------------------------------------------------------------------
// "VOL" flags
//
// These flags are used for xvid_enc_frame_t->vol_flags field during frame
// encoding (operation XVID_ENC_ENCODE)
//----------------------------------------------------------------------------

const
  XVID_VOL_MPEGQUANT = (1 shl 0);       // enable MPEG type quantization
  XVID_VOL_EXTRASTATS = (1 shl 1);      // enable plane sse stats
  XVID_VOL_QUARTERPEL = (1 shl 2);      // enable quarterpel: frames will encoded as quarterpel
  XVID_VOL_GMC = (1 shl 3);             // enable GMC; frames will be checked for gmc suitability
  XVID_VOL_REDUCED_ENABLE = (1 shl 4);  // enable reduced resolution vops: frames will be checked for rrv suitability
  XVID_VOL_INTERLACING = (1 shl 5);     // enable interlaced encoding

//----------------------------------------------------------------------------
// "VOP" flags
//
// These flags are used for xvid_enc_frame_t->vop_flags field during frame
// encoding (operation XVID_ENC_ENCODE)
//----------------------------------------------------------------------------

// Always valid
const
  XVID_VOP_DEBUG = (1 shl 0);                 // print debug messages in frames
  XVID_VOP_HALFPEL = (1 shl 1);               // use halfpel interpolation
  XVID_VOP_INTER4V = (1 shl 2);               // use 4 motion vectors per MB
  XVID_VOP_TRELLISQUANT = (1 shl 3);          // use trellis based R-D 'optimal' quantization
  XVID_VOP_CHROMAOPT = (1 shl 4);             // enable chroma optimization pre-filter
  XVID_VOP_CARTOON = (1 shl 5);               // use 'cartoon mode'
  XVID_VOP_GREYSCALE = (1 shl 6);             // enable greyscale only mode (even for color input material chroma is ignored)
  XVID_VOP_HQACPRED = (1 shl 7);              // high quality ac prediction
  XVID_VOP_MODEDECISION_RD = (1 shl 8);       // enable DCT-ME and use it for mode decision
  XVID_VOP_FAST_MODEDECISION_RD = (1 shl 12); // use simplified R-D mode decision

// Only valid for vol_flags or =XVID_VOL_INTERLACING
const
  XVID_VOP_TOPFIELDFIRST = (1 shl 9);     // set top-field-first flag
  XVID_VOP_ALTERNATESCAN = (1 shl 10);    // set alternate vertical scan flag

// only valid for vol_flags or =XVID_VOL_REDUCED_ENABLED
  XVID_VOP_REDUCED = (1 shl 11);          // reduced resolution vop

//----------------------------------------------------------------------------
// "Motion" flags
//
// These flags are used for xvid_enc_frame_t->motion field during frame
// encoding (operation XVID_ENC_ENCODE)
//----------------------------------------------------------------------------

// Motion Estimation Search Patterns
const
  XVID_ME_ADVANCEDDIAMOND16 = (1 shl 0);  // use advdiamonds instead of diamonds as search pattern
  XVID_ME_ADVANCEDDIAMOND8 = (1 shl 1);   // use advdiamond for XVID_ME_EXTSEARCH8
  XVID_ME_USESQUARES16 = (1 shl 2);       // use squares instead of diamonds as search pattern
  XVID_ME_USESQUARES8 = (1 shl 3);        // use square for XVID_ME_EXTSEARCH8

// SAD operator based flags
  XVID_ME_HALFPELREFINE16 = (1 shl 4);
  XVID_ME_HALFPELREFINE8 = (1 shl 6);
  XVID_ME_QUARTERPELREFINE16 = (1 shl 7);
  XVID_ME_QUARTERPELREFINE8 = (1 shl 8);
  XVID_ME_GME_REFINE = (1 shl 9);
  XVID_ME_EXTSEARCH16 = (1 shl 10);       // extend PMV by more searches
  XVID_ME_EXTSEARCH8 = (1 shl 11);        // use diamond/square for extended 8x8 search
  XVID_ME_CHROMA_PVOP = (1 shl 12);       // also use chroma for P_VOP/S_VOP ME
  XVID_ME_CHROMA_BVOP = (1 shl 13);       // also use chroma for B_VOP ME
  XVID_ME_FASTREFINE16 = (1 shl 25);      // use low-complexity refinement functions
  XVID_ME_FASTREFINE8 = (1 shl 29);       // low-complexity 8x8 sub-block refinement

// Rate Distortion based flags
// Valid when XVID_VOP_MODEDECISION_RD is enabled
  XVID_ME_HALFPELREFINE16_RD = (1 shl 14);    // perform RD-based halfpel refinement
  XVID_ME_HALFPELREFINE8_RD = (1 shl 15);     // perform RD-based halfpel refinement for 8x8 mode
  XVID_ME_QUARTERPELREFINE16_RD = (1 shl 16); // perform RD-based qpel refinement
  XVID_ME_QUARTERPELREFINE8_RD = (1 shl 17);  // perform RD-based qpel refinement for 8x8 mode
  XVID_ME_EXTSEARCH_RD = (1 shl 18);          // perform RD-based search using square pattern enable XVID_ME_EXTSEARCH8 to do this in 8x8 search as well
  XVID_ME_CHECKPREDICTION_RD = (1 shl 19);    // always check vector equal to prediction

// Other
  XVID_ME_DETECT_STATIC_MOTION = (1 shl 24);  // speed-up ME by detecting stationary scenes
  XVID_ME_SKIP_DELTASEARCH = (1 shl 26);      // speed-up by skipping b-frame delta search
  XVID_ME_FAST_MODEINTERPOLATE = (1 shl 27);  // speed-up by partly skipping interpolate mode
  XVID_ME_BFRAME_EARLYSTOP = (1 shl 28);      // speed-up by early exiting b-search

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -