houxiao
2017-07-19 a88fc40a16cefc8248baa4b6aab7b7577e0ba4cc
code review

git-svn-id: http://192.168.1.226/svn/proxy@730 454eff88-639b-444f-9e54-f578c98de674
29个文件已删除
4个文件已修改
2925 ■■■■■ 已修改文件
RtspFace/PL_Paint.cpp 227 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/PL_Paint.h 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/PL_Scale.cpp 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/PL_Scale.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/include/cv_common.h 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/include/cv_face.h 580 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/include/cv_utils.h 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/models/CLUSTERING_VERSION 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/models/VERIFY_VERSION 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/models/clustering.model 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/models/verify.model 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/DBuntil.cpp 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/DBuntil.h 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/FaceDBPool.cpp 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/FaceDBPool.h 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/Makefile 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/DBuntil.cpp 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/DBuntil.h 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/Makefile 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/demo.cpp 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/main.cpp 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/db/run.sh 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp 322 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/faceDB.cpp 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/faceDB.h 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/out.db 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/run.sh 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/sample_face_track.cpp 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/test.cpp 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/time_helper.h 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/SensetimeFaceAPIWrapper/src/tools.h 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
RtspFace/PL_Paint.cpp
@@ -7,6 +7,12 @@
#include <opencv2/core/mat.hpp>
#include <opencv2/imgproc.hpp>
~PLPLContext::PLPLContext()
{
    delete (CvxText*)cvxText;
    cvxText = nullptr;
}
struct PL_Paint_Internal
{
    uint8_t* buffer;
@@ -21,7 +27,7 @@
    PL_Paint_Internal() : 
        buffer(nullptr), buffSize(), config(), pmList(),
        lastMbfBuffOrigin(), lastMbfBuffCopy(),
        lastMbfBuffOrigin(), lastMbfBuffCopy(),
        payError(true)
    {
    }
@@ -79,20 +85,17 @@
        in->config = *config;
    }
    if(in->config.fontPath.empty())
    {
        LOG_ERROR << "fontPath is null!" << LOG_ENDL;
        return false;
    }
    if(in->config.plplCtx->cvxText != nullptr)
    {
        delete(in->config.plplCtx->cvxText);
    }
    CvxText* cvxText =new CvxText(in->config.fontPath.c_str());
    in->config.plplCtx->cvxText = cvxText;
    cvxText->setBackColor(cvScalar(128, 33, 14));
    CvScalar font = cvScalar(40,1,0.2,1);
    cvxText->setFont(0, &font);
    if(in->config.fontPath.empty())
    {
        LOG_ERROR << "fontPath is null!" << LOG_ENDL;
        return false;
    }
    if(in->config.plplCtx->cvxText != nullptr)
    {
        delete (CvxText*)in->config.plplCtx->cvxText;
    }
    return true;
}
@@ -121,7 +124,7 @@
    // void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
    const PLGH_Color_YUV yuvColor(plplCtx->color_front.toY(), plplCtx->color_front.toU(), plplCtx->color_front.toV());
    const PLGH_Color_YUV yuvColor(plplCtx->color_front.toY(), plplCtx->color_front.toU(), plplCtx->color_front.toV());
    cv::rectangle(yMat, cv::Point(LTX, LTY), cv::Point(RBX, RBY), CV_RGB(yuvColor.Y, yuvColor.Y, yuvColor.Y), 4);
    cv::rectangle(uMat, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), cv::Point(MH_SUBSAMPLE1(RBX, 2), MH_SUBSAMPLE1(RBY, 2)), CV_RGB(yuvColor.U, yuvColor.U, yuvColor.U), 2);
@@ -145,8 +148,8 @@
    // void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
    const uint16_t Y =  plplCtx->color_front.toY();
    const uint16_t UV = plplCtx->color_front.toUV();
    const uint16_t Y =  plplCtx->color_front.toY();
    const uint16_t UV = plplCtx->color_front.toUV();
    cv::rectangle(yMat, cv::Point(LTX, LTY), cv::Point(RBX, RBY), CV_RGB(Y, Y, Y), 4);
    cv::rectangle(uvMat, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), cv::Point(MH_SUBSAMPLE1(RBX, 2), MH_SUBSAMPLE1(RBY, 2)), CV_RGB(UV, UV, UV), 2);
@@ -175,109 +178,121 @@
    const uint16_t Y =  plplCtx->color_front.toY();
    const uint16_t UV = plplCtx->color_front.toUV();
    cv::putText(yMat, TXT, cv::Point(LTX, LTY), CV_FONT_HERSHEY_COMPLEX, 1, CV_RGB(Y, Y, Y));
    cv::putText(uvMat, TXT, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), CV_FONT_HERSHEY_COMPLEX, 0.5, CV_RGB(UV, UV, UV));
    cv::putText(yMat, TXT, cv::Point(LTX, LTY), CV_FONT_HERSHEY_COMPLEX, 1, CV_RGB(Y, Y, Y));
    cv::putText(uvMat, TXT, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), CV_FONT_HERSHEY_COMPLEX, 0.5, CV_RGB(UV, UV, UV));
}
bool plplDraw_WText_NV12(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
{
    int LTX = plplCtx->params[paramOffset + 0].val_i;
    int LTY = plplCtx->params[paramOffset + 1].val_i;
    const char* TXT = plplCtx->params[paramOffset + 2].val_s;
    paramOffset += 3;
    int LTX = plplCtx->params[paramOffset + 0].val_i;
    int LTY = plplCtx->params[paramOffset + 1].val_i;
    const char* WTXT = plplCtx->params[paramOffset + 2].val_s;
    paramOffset += 3;
    int src_width = paintMb->width;
    int src_height = paintMb->height;
    uint8_t* src_y = (uint8_t*)(paintMb->buffer);
    uint8_t* src_uv = (uint8_t*)(src_y + (src_height * src_width));
    cv::Mat yMat(cv::Size(src_width, src_height), CV_8UC1, src_y);
    cv::Mat uvMat(cv::Size(MH_SUBSAMPLE1(src_width, 2), MH_SUBSAMPLE1(src_height, 2)), CV_16UC1, src_uv);
    int src_width = paintMb->width;
    int src_height = paintMb->height;
    uint8_t* src_y = (uint8_t*)(paintMb->buffer);
    uint8_t* src_uv = (uint8_t*)(src_y + (src_height * src_width));
    cv::Mat yMat(cv::Size(src_width, src_height), CV_8UC1, src_y);
    cv::Mat uvMat(cv::Size(MH_SUBSAMPLE1(src_width, 2), MH_SUBSAMPLE1(src_height, 2)), CV_16UC1, src_uv);
    // void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
    // void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
    const uint16_t Y =  plplCtx->color_front.toY();
    const uint16_t UV = plplCtx->color_front.toUV();
    CvxText* cvText = (CvxText*)plplCtx->cvxText;
    cvText->putText(yMat, L"中文ABCDabcd", cv::Point(LTX, LTY), CV_RGB(Y, Y, Y));
    cvText->putText(uvMat, L"中文ABCDabcd", cv::Point(MH_SUBSAMPLE1(LTX, 2),MH_SUBSAMPLE1(LTY, 2)), CV_RGB(UV, UV, UV));
    if (in->config.plplCtx->cvxText == nullptr)
    {
        CvxText* cvxText = new CvxText(in->config.fontPath.c_str());
        in->config.plplCtx->cvxText = cvxText;
        cvxText->setBackColor(cvScalar(128, 33, 14));
        CvScalar font = cvScalar(40, 1, 0.2, 1);
        cvxText->setFont(0, &font);
    }
    const uint16_t Y =  plplCtx->color_front.toY();
    const uint16_t UV = plplCtx->color_front.toUV();
    CvxText* cvText = (CvxText*)plplCtx->cvxText;
    cvText->putText(yMat, (const wchar_t*)WTXT, cv::Point(LTX, LTY), CV_RGB(Y, Y, Y)); // L"中文ABCDabcd"
    cvText->putText(uvMat, (const wchar_t*)WTXT, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), CV_RGB(UV, UV, UV)); // L"中文ABCDabcd"
}
bool plplExecutor_YUV(PL_Paint_Internal *in)
{
    MB_Frame* paintMb = &(in->lastMbfBuffOrigin);
    MB_Frame* paintMb = &(in->lastMbfBuffOrigin);
    int ret = true;
    if (in->config.copyData)
    {
        if (in->buffer == nullptr)
        {
            in->buffer = new uint8_t[in->lastMbfBuffOrigin.buffSize];
            in->buffSize = in->lastMbfBuffOrigin.buffSize;
        }
    if (in->config.copyData)
    {
        if (in->buffer == nullptr)
        {
            in->buffer = new uint8_t[in->lastMbfBuffOrigin.buffSize];
            in->buffSize = in->lastMbfBuffOrigin.buffSize;
        }
        in->lastMbfBuffCopy = in->lastMbfBuffOrigin;
        in->lastMbfBuffCopy.buffer = in->buffer;
        in->lastMbfBuffCopy.buffSize = in->buffSize;
        in->lastMbfBuffCopy = in->lastMbfBuffOrigin;
        in->lastMbfBuffCopy.buffer = in->buffer;
        in->lastMbfBuffCopy.buffSize = in->buffSize;
        memcpy(in->lastMbfBuffCopy.buffer, in->lastMbfBuffOrigin.buffer, in->lastMbfBuffCopy.buffSize);
        memcpy(in->lastMbfBuffCopy.buffer, in->lastMbfBuffOrigin.buffer, in->lastMbfBuffCopy.buffSize);
        paintMb = &(in->lastMbfBuffCopy);
    }
        paintMb = &(in->lastMbfBuffCopy);
    }
    //for (int i=640;i<2000;i++) ((uint8_t*)paintMb->buffer)[i]=255;
    //for (int i=640;i<2000;i++) ((uint8_t*)paintMb->buffer)[i]=255;
    PLPLContext* plplCtx = in->config.plplCtx;
    int paramOffset = 0;
    for (int iCmd = 0; iCmd < in->config.plplCtx->cmds.size(); iCmd++)
    {
        PLPLCmd cmd = plplCtx->cmds[iCmd];
    PLPLContext* plplCtx = in->config.plplCtx;
    int paramOffset = 0;
    for (int iCmd = 0; iCmd < in->config.plplCtx->cmds.size(); iCmd++)
    {
        PLPLCmd cmd = plplCtx->cmds[iCmd];
        switch(cmd)
        {
            case PLPLC_COLOR:
                //COLOR F/B,R,G,B,A
                if (plplCtx->params[paramOffset + 0].val_i == 'F')
                {
                    plplCtx->color_front = PLGH_Color_RGBA(plplCtx->params[paramOffset + 1].val_i,
                                                     plplCtx->params[paramOffset + 2].val_i,
                                                     plplCtx->params[paramOffset + 3].val_i,
                                                     plplCtx->params[paramOffset + 4].val_i);
                    paramOffset += 5;
                }
                else if (plplCtx->params[paramOffset + 0].val_i == 'B')
                {
                    plplCtx->color_back = PLGH_Color_RGBA(plplCtx->params[paramOffset + 1].val_i,
                                                    plplCtx->params[paramOffset + 2].val_i,
                                                    plplCtx->params[paramOffset + 3].val_i,
                                                    plplCtx->params[paramOffset + 4].val_i);
                    paramOffset += 5;
                }
                else
                {
                    LOG_WARN << "plpl execute error" << LOG_ENDL;
                    return false;
                }
                break;
        switch(cmd)
        {
            case PLPLC_COLOR:
                //COLOR F/B,R,G,B,A
                if (plplCtx->params[paramOffset + 0].val_i == 'F')
                {
                    plplCtx->color_front = PLGH_Color_RGBA(plplCtx->params[paramOffset + 1].val_i,
                                                     plplCtx->params[paramOffset + 2].val_i,
                                                     plplCtx->params[paramOffset + 3].val_i,
                                                     plplCtx->params[paramOffset + 4].val_i);
                    paramOffset += 5;
                }
                else if (plplCtx->params[paramOffset + 0].val_i == 'B')
                {
                    plplCtx->color_back = PLGH_Color_RGBA(plplCtx->params[paramOffset + 1].val_i,
                                                    plplCtx->params[paramOffset + 2].val_i,
                                                    plplCtx->params[paramOffset + 3].val_i,
                                                    plplCtx->params[paramOffset + 4].val_i);
                    paramOffset += 5;
                }
                else
                {
                    LOG_WARN << "plpl execute error" << LOG_ENDL;
                    return false;
                }
                break;
            case PLPLC_FILL:
                plplCtx->fill = plplCtx->params[paramOffset + 0].val_i;
                paramOffset += 1;
                break;
            case PLPLC_FILL:
                plplCtx->fill = plplCtx->params[paramOffset + 0].val_i;
                paramOffset += 1;
                break;
            case PLPLC_PEN:
                plplCtx->pen = PLGH_Pen(plplCtx->params[paramOffset + 0].val_i, plplCtx->params[paramOffset + 1].val_i);
                paramOffset += 2;
                break;
            case PLPLC_PEN:
                plplCtx->pen = PLGH_Pen(plplCtx->params[paramOffset + 0].val_i, plplCtx->params[paramOffset + 1].val_i);
                paramOffset += 2;
                break;
            case PLPLC_RECT:
                //RECT LTX,LTY,RBX,RBY
            case PLPLC_RECT:
                //RECT LTX,LTY,RBX,RBY
                if (paintMb->type == MB_Frame::MBFT_YUV420)
                    ret = plplDraw_Rect_YUV420(plplCtx, paintMb, paramOffset);
                else if (paintMb->type == MB_Frame::MBFT_NV12)
                    ret = plplDraw_Rect_NV12(plplCtx, paintMb, paramOffset);
                else
                    ret = false;
                break;
                break;
            case PLPLC_TEXT:
            case PLPLC_TEXT:
                //TEXT LTX,LTY,"STR"
                if (paintMb->type == MB_Frame::MBFT_YUV420)
                    ret = plplDraw_Text_YUV420(plplCtx, paintMb, paramOffset);
@@ -285,17 +300,17 @@
                    ret = plplDraw_Text_NV12(plplCtx, paintMb, paramOffset);
                else
                    ret = false;
                break;
                break;
            case PLPLC_WTEXT:
                //TEXT LTX,LTY,"STR"
                if (paintMb->type == MB_Frame::MBFT_NV12)
                    ret = plplDraw_WText_NV12(plplCtx, paintMb, paramOffset);
                else
                    ret = false;
                break;
        }
    }
            case PLPLC_WTEXT:
                //WTEXT LTX,LTY,"STR"
                if (paintMb->type == MB_Frame::MBFT_NV12)
                    ret = plplDraw_WText_NV12(plplCtx, paintMb, paramOffset);
                else
                    ret = false;
                break;
        }
    }
    return ret;
}
@@ -337,8 +352,8 @@
{
    PL_Paint_Internal* in = (PL_Paint_Internal*)internal;
    in->payError = true;
    pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_YUV420, PL_Paint::pay_breaker_MBFT_YUV, in);
    pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_NV12, PL_Paint::pay_breaker_MBFT_YUV, in);
    pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_YUV420, PL_Paint::pay_breaker_MBFT_YUV, in);
    pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_NV12, PL_Paint::pay_breaker_MBFT_YUV, in);
    //#todo support RGB
    
RtspFace/PL_Paint.h
@@ -22,7 +22,8 @@
    PLPLC_PEN,
    PLPLC_RECT,
    PLPLC_TEXT,
    PLPLC_WTEXT,
    PLPLC_WTEXT,
    PLPLC__LAST
};
@@ -32,19 +33,20 @@
    float val_f;
    char val_s[10];
    PLPLType() : val_i(0) {}
    PLPLType(int _val_i) : val_i(_val_i) {}
    PLPLType(float _val_f) : val_f(_val_f) {}
    PLPLType(const char* _val_s)
    {
        for (int i = 0; i < sizeof(val_s); i++)
            val_s[i] = _val_s[i];
    }
    PLPLType(const wchar_t* _val_s)
    {
        for (int i = 0; i < sizeof(val_s); i++)
            val_s[i] = _val_s[i];
    }
    PLPLType() : val_i(0) {}
    PLPLType(int _val_i) : val_i(_val_i) {}
    PLPLType(float _val_f) : val_f(_val_f) {}
    PLPLType(const char* _val_s)
    {
        for (int i = 0; i < sizeof(val_s); i++)
            val_s[i] = _val_s[i];
    }
    PLPLType(const wchar_t* _val_s)
    {
        wchar_t* w_val_s = (wchar_t*)val_s;
        for (int i = 0; i < sizeof(val_s) / sizeof(wchar_t); i++)
            w_val_s[i] = _val_s[i];
    }
};
typedef std::vector<PLPLCmd> plplc_vec_t;
@@ -55,30 +57,27 @@
    plplc_vec_t cmds;
    plplt_vec_t params;
    PLGH_Color_RGBA color_front;
    PLGH_Color_RGBA color_back;
    int fill;
    PLGH_Pen pen;
    void* cvxText;
    PLPLContext() :
            cmds(), params(), color_front(), color_back(), fill(0), pen(0, 0), cvxText(nullptr)
    {}
    PLGH_Color_RGBA color_front;
    PLGH_Color_RGBA color_back;
    int fill;
    PLGH_Pen pen;
    void* cvxText;
    ~PLPLContext()
    {
        delete(cvxText);
        cvxText = nullptr;
    }
    PLPLContext() :
        cmds(), params(), color_front(), color_back(), fill(0), pen(0, 0), cvxText(nullptr)
    {}
    ~PLPLContext();
};
struct PL_Paint_Config
{
    bool copyData;
    PLPLContext* plplCtx;
    std::string fontPath;
    std::string fontPath;
    
    PL_Paint_Config() : 
        copyData(false), plplCtx(nullptr), fontPath()
        copyData(false), plplCtx(nullptr), fontPath(" ")
    { }
};
RtspFace/PL_Scale.cpp
@@ -2,7 +2,7 @@
#include "MaterialBuffer.h"
#include "logger.h"
#include <libyuv.h>
#include <android/native_window.h>
struct PL_Scale_Internal
{
    uint8_t* buffer;
@@ -94,8 +94,8 @@
{
#define SUBSAMPLE(v, a) ((((v) + (a) - 1)) / (a))
    const int dst_width = in->config.toWidth;
    const int dst_height = in->config.toHeight;
    const int dst_width = in->config.toWidth;
    const int dst_height = in->config.toHeight;
    size_t dstSizeMax = 0;
    if (srcType == MB_Frame::MBFT_YUV420||srcType == MB_Frame::MBFT_NV12)
@@ -139,42 +139,43 @@
            
        in->buffSize = dstSizeMax;
    }
    else if (srcType == MB_Frame::MBFT_NV12)
    {
        const uint8_t* src_y = (const uint8_t*)(srcBuffer);
        const uint8_t* src_uv = (const uint8_t*)(src_y + (srcHeight * srcWidth));
        if (srcWidth != dst_width || srcHeight != dst_height)
        {
            // RK3288, 1920->640: 2.8~12ms, avg=4ms
    else if (srcType == MB_Frame::MBFT_NV12)
    {
        const uint8_t* src_y = (const uint8_t*)(srcBuffer);
        const uint8_t* src_uv = (const uint8_t*)(src_y + (srcHeight * srcWidth));
        if (srcWidth != dst_width || srcHeight != dst_height)
        {
            // RK3288, 1920->640: 2.8~12ms, avg=4ms
            uint8_t* dst_y = (uint8_t*)(in->buffer);
            uint8_t* dst_uv = (uint8_t*)(dst_y + (dst_height * dst_width));
            uint8_t* dst_y = (uint8_t*)(in->buffer);
            uint8_t* dst_uv = (uint8_t*)(dst_y + (dst_height * dst_width));
            libyuv::ScalePlane(src_y, srcWidth,
                               srcWidth, srcHeight,
                               dst_y, dst_width,
                               dst_width, dst_height,
                               libyuv::kFilterNone);
            libyuv::ScalePlane(src_y, srcWidth,
                               srcWidth, srcHeight,
                               dst_y, dst_width,
                               dst_width, dst_height,
                               libyuv::kFilterNone);
            libyuv::ScalePlane_16((uint16*)src_uv, SUBSAMPLE(srcWidth, 2),
                                  SUBSAMPLE(srcWidth, 2), SUBSAMPLE(srcHeight, 2),
                                  (uint16*)dst_uv, SUBSAMPLE(dst_width, 2),
                                  SUBSAMPLE(dst_width, 2), SUBSAMPLE(dst_height, 2),
                                  libyuv::kFilterNone);
            in->buffSize = dstSizeMax;
        }
        else if (srcType == MB_Frame::MBFT_BGRA)
        {
            //#todo
            LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_NV12" << std::endl;
            return false;
        } else
        {
            LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_NV12" << std::endl;
            return false;
        }
        return true;
    }
            libyuv::ScalePlane_16((uint16*)src_uv, SUBSAMPLE(srcWidth, 2),
                                  SUBSAMPLE(srcWidth, 2), SUBSAMPLE(srcHeight, 2),
                                  (uint16*)dst_uv, SUBSAMPLE(dst_width, 2),
                                  SUBSAMPLE(dst_width, 2), SUBSAMPLE(dst_height, 2),
                                  libyuv::kFilterNone);
            in->buffSize = dstSizeMax;
        }
        else if (srcType == MB_Frame::MBFT_BGRA)
        {
            //#todo
            LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_NV12" << std::endl;
            return false;
        }
        else
        {
            LOG_ERROR << "srcType only support MBFT_YUV420 and MBFT_NV12" << std::endl;
            return false;
        }
        return true;
    }
}
bool PL_Scale::pay(const PipeMaterial& pm)
@@ -222,32 +223,32 @@
        }
    }
    break;
        case PipeMaterial::PMT_PM_LIST:
        {
            // break pm list into single pm(s)
        case PipeMaterial::PMT_PM_LIST:
        {
            // break pm list into single pm(s)
            MB_Frame* ppm = (MB_Frame*)pm.buffer;
            for (size_t i = 0; i < pm.buffSize; i++, ppm++)
            {
                if (ppm->type== PipeMaterial::PMT_FRAME)
                {
                    MB_Frame* frame = (MB_Frame*)ppm->buffer;
                    switch(frame->type)
                    {
                        case MB_Frame::MBFT_YUV420:
                        case MB_Frame::MBFT_BGRA:
                        case MB_Frame::MBFT_NV12:
                            in->lastFrame = *frame;
                            ret = image_scale(in, (uint8_t*)frame->buffer,frame->type,
                                              frame->width, frame->height);
                            break;
                        default:
                            LOG_ERROR << "Only support MBFT_YUV420 / MBFT_BGRA" << std::endl;
                            return false;
                    }
                }
            }
        }break;
            MB_Frame* ppm = (MB_Frame*)pm.buffer;
            for (size_t i = 0; i < pm.buffSize; i++, ppm++)
            {
                if (ppm->type== PipeMaterial::PMT_FRAME)
                {
                    MB_Frame* frame = (MB_Frame*)ppm->buffer;
                    switch(frame->type)
                    {
                        case MB_Frame::MBFT_YUV420:
                        case MB_Frame::MBFT_BGRA:
                        case MB_Frame::MBFT_NV12:
                            in->lastFrame = *frame;
                            ret = image_scale(in, (uint8_t*)frame->buffer,frame->type,
                                              frame->width, frame->height);
                            break;
                        default:
                            LOG_ERROR << "Only support MBFT_YUV420 / MBFT_BGRA" << std::endl;
                            return false;
                    }
                }
            }
        }break;
    default:
        LOG_ERROR << "Only support PMT_BYTES / PMT_FRAME" << std::endl;
        return false;
@@ -275,7 +276,7 @@
    }
    break;
    case PipeMaterial::PMT_FRAME:
    case PipeMaterial::PMT_PM_LIST:
    case PipeMaterial::PMT_PM_LIST:
    {
        newPm.type = PipeMaterial::PMT_FRAME;
        newPm.buffer = &(in->lastFrame);
RtspFace/PL_Scale.h
@@ -5,7 +5,6 @@
struct PL_Scale_Config
{
    void* windowSurface;
    uint16_t toWidth;
    uint16_t toHeight;
    int filterMode; // libyuv/scale.h/FilterMode 
RtspFace/SensetimeFaceAPIWrapper/include/cv_common.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/include/cv_face.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/include/cv_utils.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/models/CLUSTERING_VERSION
File was deleted
RtspFace/SensetimeFaceAPIWrapper/models/VERIFY_VERSION
File was deleted
RtspFace/SensetimeFaceAPIWrapper/models/clustering.model
Binary files differ
RtspFace/SensetimeFaceAPIWrapper/models/verify.model
RtspFace/SensetimeFaceAPIWrapper/src/DBuntil.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/DBuntil.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/FaceDBPool.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/FaceDBPool.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/Makefile
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/DBuntil.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/DBuntil.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/Makefile
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/demo.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/main.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/db/run.sh
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/faceAPI.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/faceDB.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/faceDB.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/out.db
Binary files differ
RtspFace/SensetimeFaceAPIWrapper/src/run.sh
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/sample_face_track.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/test.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/time_helper.h
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/tools.cpp
File was deleted
RtspFace/SensetimeFaceAPIWrapper/src/tools.h
File was deleted