]> git.vomp.tv Git - vompclient.git/commitdiff
Fix image_fx deinterlace parameters and add additional deinterlacer modes
authorMarten Richter <marten.richter@freenet.de>
Sat, 4 Mar 2017 16:02:01 +0000 (17:02 +0100)
committerMarten Richter <marten.richter@freenet.de>
Sat, 4 Mar 2017 16:02:01 +0000 (17:02 +0100)
videoomx.cc

index 57e6511f4c14b26cbb56f4ea65ff4e641877b4e8..abe91dbbd6c34530c0f5a56d5369b8e25121ebd8 100644 (file)
@@ -252,7 +252,9 @@ bool VideoOMX::loadOptionsfromServer(VDR* vdr)
                        deinterlace = 2;
                } /*else if (STRCASECMP(name, "Crazy") == 0) {
                        deinterlace = 3; // this does not activate deinterlacing but a image filter, just for fun
-               }*/
+               }*/ else if (STRCASECMP(name, "Fast") == 0) {
+                       deinterlace = 4;
+               }
                Log::getInstance()->log("Video", Log::DEBUG, "Set deinterlacing to %s %d",name,deinterlace);
                delete[] name;
        }
@@ -278,7 +280,10 @@ bool VideoOMX::handleOptionChanges(Option* option)
                } /*else if (STRCASECMP(option->options[option->userSetChoice], "Crazy")
                                == 0) {
                        deinterlace = 3;
-               }*/
+               }*/ else if (STRCASECMP(option->options[option->userSetChoice], "Fast")
+                       == 0) {
+                       deinterlace = 4;
+               }
                Log::getInstance()->log("Video", Log::DEBUG, "Set deinterlacing to %s %d",option->options[option->userSetChoice],deinterlace);
                return true;
        }
@@ -304,6 +309,9 @@ bool VideoOMX::saveOptionstoServer()
        /*case 3:
                VDR::getInstance()->configSave("VideoOMX","SDDeinterlacing", "Crazy");
                break;*/
+       case 4:
+               VDR::getInstance()->configSave("VideoOMX", "SDDeinterlacing", "Fast");
+               break;
        };
 
     return true;
@@ -321,8 +329,8 @@ bool VideoOMX::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pa
     Option* option;
     if (panenumber == 2)
     {
-       static const char* deinterlaceopts[]={"None",/*"LineDouble",*/"Advanced"/*,"Crazy"*/};
-       option = new Option(1,tr("SD Deinterlacing"), "VideoOMX","SDDeinterlacing",Option::TYPE_TEXT,/*4,2*/2,1,0,deinterlaceopts,NULL,false,this);
+               static const char* deinterlaceopts[] = { "None", "Fast",/*"LineDouble",*/"Advanced"/*,"Crazy"*/ };
+       option = new Option(1,tr("SD Deinterlacing"), "VideoOMX","SDDeinterlacing",Option::TYPE_TEXT,/*4,2*/3,2,0,deinterlaceopts,NULL,false,this);
        options->push_back(option);
        pane->addOptionLine(option);
     }
@@ -1069,7 +1077,7 @@ int VideoOMX::AllocateCodecsOMX()
        //Clock, move later to audio including events
 
        Log::getInstance()->log("Video", Log::NOTICE, "Deinter VideoType %d x %d i: %d", demux->getHorizontalSize(),demux->getVerticalSize(),demux->getInterlaced());
-       if (deinterlace!=0 && /*(demux->getHorizontalSize()<=720 ) &&*/ demux->getInterlaced()) { //only deinterlace SD material
+       if (deinterlace!=0 && /*(demux->getHorizontalSize()<=720 ) &&*/ demux->getInterlaced()) { 
                dodeint=true;
 
 
@@ -1436,8 +1444,11 @@ int VideoOMX::AllocateCodecsOMX()
                imagefilter.nVersion.nVersion=OMX_VERSION;
 
                imagefilter.nPortIndex=omx_deint_output_port;
-               imagefilter.nNumParams=1;
+               imagefilter.nNumParams=4;
                imagefilter.nParams[0]=3;//???
+               imagefilter.nParams[1]=0;//default frame interval
+               imagefilter.nParams[2]=0;// frame rate
+               imagefilter.nParams[3]=1;//use qpels //whatever this is from mpeg?
                switch (deinterlace) {
                case 1:
                        imagefilter.eImageFilter=OMX_ImageFilterDeInterlaceLineDouble; break;
@@ -1445,6 +1456,8 @@ int VideoOMX::AllocateCodecsOMX()
                        imagefilter.eImageFilter=OMX_ImageFilterDeInterlaceAdvanced; break;
                case 3:
                        imagefilter.eImageFilter=OMX_ImageFilterFilm; break;
+               case 4:
+                       imagefilter.eImageFilter = OMX_ImageFilterDeInterlaceFast; break;
                }
 
 
@@ -2682,14 +2695,14 @@ void VideoOMX::FirstFrameFix()
                                return;
                        }
                        Log::getInstance()->log("Video", Log::DEBUG,
-                                       "Deinit first frame fix3 %d %d %d %d %d %d %d %d",port_def_type.format.video.nFrameWidth , demux->getHorizontalSize(),
-                                       port_def_type.format.video.nFrameHeight , demux->getVerticalSize(),port_def_type.format.video.nStride,
-                                       port_def_type.format.video.nSliceHeight, port_def_type.format.video.xFramerate,
-                                       port_def_type.format.video.bFlagErrorConcealment );
+                                       "Deinit first frame fix3 %d %d %d %d %d %d %d ",port_def_type.format.image.nFrameWidth , demux->getHorizontalSize(),
+                                       port_def_type.format.image.nFrameHeight , demux->getVerticalSize(),port_def_type.format.image.nStride,
+                                       port_def_type.format.image.nSliceHeight, /*port_def_type.format.image.xFramerate,*/
+                                       port_def_type.format.image.bFlagErrorConcealment );
                        Log::getInstance()->log("Video", Log::DEBUG,
                                        "Deinit first frame fix4 %d  %d",
-                                       port_def_type.format.video.eCompressionFormat ,
-                                       port_def_type.format.video.eColorFormat );
+                                       port_def_type.format.image.eCompressionFormat ,
+                                       port_def_type.format.image.eColorFormat );
                        DisablePort(omx_vid_deint,omx_deint_output_port,true);
 
                }