From patchwork Thu Jul 2 10:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 8552 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 11F1BBE905 for ; Thu, 2 Jul 2020 10:53:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9929660C56; Thu, 2 Jul 2020 12:53:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="UZ30JaAX"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C74B1603B3 for ; Thu, 2 Jul 2020 12:53:40 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id f18so19543992wrs.0 for ; Thu, 02 Jul 2020 03:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YRRr53AknftWtT7iWm58eE/jwbqmSe9EYHbX4tM0zWE=; b=UZ30JaAX16cgZdymZSp6S2SkmegKXdRWgRUILrnAIS9RtEEJvyDaHthrGGDouRGhQE oEQkgRx85u2cgTsBFEUnO0/D/x58apLGz5AW5CTBt7Q/gXqTj6Mg4vY+VNTO9fPdHlNE NxN394BY+J/gcc8uBia/RNCOI1OeuXW595QNd7XAUnbHnJ5vusOZ7WrM9q4MObk2dOOn 1pDpgb3DmjC78m9Lrfcq5F3vplGZHKmP7Iwrx2CHj3rxm45UASQ4L4r+aK/nT9HfeLq1 crnxCtcyzchTcGUERT6EOU0csntS9XKSWHE9HNoB40ogQvvgTM25FeTZYihV+gxM1PGJ hhsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YRRr53AknftWtT7iWm58eE/jwbqmSe9EYHbX4tM0zWE=; b=PHnlmuwJWQ2Zt8cPXkZSw2MGRqgq1sAMRUQ+h3QIF5ycT6VDu55W8JrILfyGCy+VhQ JDZyAC9S80SfvSINknjq1LAyDloUVVU4FJhLAmNVZsSfbtHEkXJA9e0ZbVYmp4Oy7NgX VAKPcaLOlRK5fLiDT0HULfyrxUjAtoWWdglNHUr24+5l1jenBUo6l6n+8NTHd3gv0ysB BQ3+7iB0Yujct1UaXPuWQ1z3FiNgXOHafY0vT/Ncwn8ZCaV7YR3AP+KhNhxYVntO3Rci fjWeFDvLqS8ArLCuqMIFaEm8RP867LKMACa815kKPpozSV3bxTwE8mcq3QABHdxJayaj LRSw== X-Gm-Message-State: AOAM530m7hTmL0IHevkciKkJwaV/nqXy3ugRvBFrEedF98MKx9h6o1Db nTgTYobHwdwMKBEO2s7pMkVHWKZ9GtQ= X-Google-Smtp-Source: ABdhPJxP+zC0Dl4zPM+3ifChAyu0QTuBSYxuITWygn/2xb+v8ISUppQknaV5RTxgcHkDuu9PcaMqWw== X-Received: by 2002:adf:8104:: with SMTP id 4mr31508169wrm.18.1593687220125; Thu, 02 Jul 2020 03:53:40 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id p25sm9768444wmg.39.2020.07.02.03.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 03:53:39 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Jul 2020 11:53:35 +0100 Message-Id: <20200702105337.31161-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] Digital zoom implementation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi everyone This patch set implements digital zoom. I don't think it's ready for prime time yet but it seemed to me to be a good way to move the discussion beyond the somewhat theoretical stage and towards something a bit more practical. It follows the path of my previous emails, and consists of two patches. The first is the general infrastructure one and adds the DigitalZoom control. I ummed and erred for a while over what to call it, but I think "digital zoom" really does describe it best. I think most people are familiar with the idea of picking just part of an image and zooming it back up to the size of the unzoomed output. Next, I also add a function to get the "sensorCrop". Again, terminology is perhaps an issue here, but it gets you those pixel dimensions from the sensor, adjusted for output aspect ratio, within which you can then zoom. As far as I can see, it's only the pipeline handler that actually calculates this, and it depends on both the camera mode and the output size, so this seemed a reasonable way to get these numbers back to an application. The second patch implements this for the Raspberry Pi. Mostly controls get sent to the IPAs and handled there, but this one needs to be intercepted and actioned by the pipeline handler. Additionally, we make the pipeline handler responsible for updating the return values (the "digital zoom" actually used) in the metadata. Anyway, I hope this all makes sense. As I said, I think there's some further discussion to be had before we take this further, so I look forward to some feedback! Thanks and best regards David David Plowman (2): libcamera: Implement digital zoom libcamera: raspberrypi: Implement digital zoom include/libcamera/camera.h | 2 + include/libcamera/internal/pipeline_handler.h | 4 ++ include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 10 ++++ src/libcamera/camera.cpp | 26 ++++++++ src/libcamera/control_ids.yaml | 10 ++++ .../pipeline/raspberrypi/raspberrypi.cpp | 59 +++++++++++++++++++ 7 files changed, 112 insertions(+)