vf_codecview.c在未来'中打印运动矢量。只要

时间:2018-02-21 09:30:15

标签: c ffmpeg video-processing

我试图了解ffmpeg绘制运动矢量的方式。

我浏览了vf_codecview.c文件并看到了draw_arrow函数,该函数只接受source > 0仅暗示未来的那些向量。

有谁知道为什么会这样?如果ffmpeg通过这个文件只占用未来,那么计算过去和未来的用途是什么?

1 个答案:

答案 0 :(得分:0)

似乎不是这种情况

source可以采用正值或负值。

/**
 * Where the current macroblock comes from; negative value when it comes
 * from the past, positive value when it comes from the future.
 * XXX: set exact relative ref frame reference instead of a +/- 1 "direction".
 */
int32_t source;

在您关联的来电中,我们有

if ((direction == 0 && (s->mv & MV_P_FOR)  && frame->pict_type == AV_PICTURE_TYPE_P) ||
    (direction == 0 && (s->mv & MV_B_FOR)  && frame->pict_type == AV_PICTURE_TYPE_B) ||
    (direction == 1 && (s->mv & MV_B_BACK) && frame->pict_type == AV_PICTURE_TYPE_B))
    draw_arrow(frame->data[0], mv->dst_x, mv->dst_y, mv->src_x, mv->src_y,
              frame->width, frame->height, frame->linesize[0],
              100, 0, mv->source > 0);

如果从过去的帧预测宏块,则最后一个表达式的计算结果为0并传递给1,否则为2.5

条件明确允许过去和未来预测的宏块。

P.S。你正在查看ver function countdown(){ var session = document.getElementById("count").value; var time = document.getElementById("input").value =+session*60; var breakm = document.getElementById("break").value; var breaktime =document.getElementById("input").value =+breakm*60; var display = document.getElementById("input").value; var sec = 1; var myVar = setInterval(myTimer, 1000); function myTimer(){ document.getElementById("input").value = time--; if(time===0){ window.clearInterval(myVar); var myVar2 = setInterval(increase, 1000); function increase(){ document.getElementById("input").value = breaktime--; if (breaktime===0) { clearInterval(myVar2); } } } } } 的来源,这是非常古老的。当前版本为https://ffmpeg.org/doxygen/trunk/vf__codecview_8c_source.html#l00256