Ticket #1786: top_option_20110523.diff

File top_option_20110523.diff, 2.2 KB (added by jarekczek@…, 15 years ago)

patch - manual top option for xvid

  • libmpcodecs/ve_xvid4.c

     
    164164static int xvidenc_packed = 0;
    165165static int xvidenc_closed_gop = 1;
    166166static int xvidenc_interlaced = 0;
     167static int xvidenc_top= -1;
    167168static int xvidenc_quarterpel = 0;
    168169static int xvidenc_gmc = 0;
    169170static int xvidenc_trellis = 1;
     
    257258        {"noclosed_gop", &xvidenc_closed_gop, CONF_TYPE_FLAG, 0, 1, 0, NULL},
    258259        {"interlacing", &xvidenc_interlaced, CONF_TYPE_FLAG, 0, 0, 1, NULL},
    259260        {"nointerlacing", &xvidenc_interlaced, CONF_TYPE_FLAG, 0, 1, 0, NULL},
     261        {"top", &xvidenc_top, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL},
    260262        {"cartoon", &xvidenc_cartoon, CONF_TYPE_FLAG, 0, 0, 1, NULL},
    261263        {"nocartoon", &xvidenc_cartoon, CONF_TYPE_FLAG, 0, 1, 0, NULL},
    262264        {"hq_ac", &xvidenc_hqacpred, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     
    12961298                return BAD;
    12971299        }
    12981300
     1301        /* Set interlacing flags */
     1302        if (frame->vol_flags & XVID_VOL_INTERLACING) {
     1303                if (xvidenc_top==-1) {
     1304                        // this piece doesn't work - don't know why mpi->fields are always 0
     1305                        //mp_msg(MSGT_DECVIDEO, MSGL_INFO, "mpi->fields=%X %d\n", mpi->fields, mpi->fields);
     1306                        if ((mpi->fields & MP_IMGFIELD_ORDERED) && (mpi->fields & MP_IMGFIELD_INTERLACED))
     1307                                if (mpi->fields & MP_IMGFIELD_TOP_FIRST)
     1308                                        frame->vop_flags |= XVID_VOP_TOPFIELDFIRST;
     1309                                else
     1310                                        frame->vop_flags &= ~XVID_VOP_TOPFIELDFIRST;
     1311                }
     1312                else {
     1313                        if (xvidenc_top==1)
     1314                                frame->vop_flags |= XVID_VOP_TOPFIELDFIRST;
     1315                        else
     1316                                frame->vop_flags &= ~XVID_VOP_TOPFIELDFIRST;
     1317                }
     1318        }
     1319
    12991320        /* Bind source frame */
    13001321        frame->input.plane[0]  = mpi->planes[0];
    13011322        frame->input.plane[1]  = mpi->planes[1];
  • DOCS/man/en/mplayer.1

     
    1009710097which you can activate with \-vf scale=<width>:<height>:1.
    1009810098.
    1009910099.TP
     10100.B "top=<\-1\-1>\ \ \ "
     10101.PD 0
     10102.RSs
     10103.IPs \-1
     10104automatic
     10105.IPs 0
     10106bottom field first
     10107.IPs 1
     10108top field first
     10109.RE
     10110.PD 1
     10111.
     10112.TP
    1010010113.B min_iquant=<0\-31>
    1010110114minimum I-frame quantizer (default: 2)
    1010210115.