gd_dsp_cmd.h 163 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323
  1. /*!
  2. *****************************************************************************
  3. ** \file gd_lib/GK7101/inc/gd_dsp_cmd.h
  4. **
  5. ** \version $Id$
  6. **
  7. ** \brief
  8. **
  9. ** \attention THIS SAMPLE CODE IS PROVIDED AS IS. GOKE MICROELECTRONICS
  10. ** ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR
  11. ** OMMISSIONS
  12. **
  13. ** (C) Copyright 2012-2013 by GOKE MICROELECTRONICS CO.,LTD
  14. **
  15. *****************************************************************************
  16. */
  17. #ifndef _GD_IDSP_CMD_H_
  18. #define _GD_IDSP_CMD_H_
  19. #include <gtypes.h>
  20. #include <gmodids.h>
  21. #include "gd_i2c.h"
  22. //*****************************************************************************
  23. //*****************************************************************************
  24. //** Defines and Macros
  25. //*****************************************************************************
  26. //*****************************************************************************
  27. #define GD_IDSP_SECTION_FILTER(x,y) ((x<<8)|(y<<4))
  28. /* Configuration commands */
  29. #define GD_INTERRUPT_SETUP 0x00001001
  30. #define GD_H264_ENCODING_SETUP 0x00001002
  31. #define GD_JPEG_ENCODING_SETUP 0x00001003
  32. #define GD_H264_DECODING_SETUP 0x00001004
  33. #define GD_JPEG_DECODING_SETUP 0x00001005
  34. #define GD_RESET_OPERATION 0x00001006
  35. #define GD_VIDEO_OUTPUT_RESTART 0x00001007
  36. #define GD_H264_ENC_USE_TIMER 0x00001008
  37. #define GD_CHIP_SELECTION 0x00001009
  38. #define GD_HD_ECHO_SETUP 0x0000100A
  39. #define GD_SYSTEM_SETUP_INFO 0x0000100B
  40. #define GD_EIS_SWITCHVOUT_DURING_ENCODE 0x0000100C
  41. #define GD_DSP_DEBUG_LEVEL_SETUP 0x0000100D
  42. #define GD_SYSTEM_PARAMETERS_SETUP 0x0000100E
  43. #define GD_SYSTEM_IDSP_FREQ_SETUP 0x0000100F
  44. #define GD_SENSOR_INPUT_SETUP 0x00002001
  45. #define GD_RGB_GAIN_ADJUSTMENT 0x00002002
  46. #define GD_VIGNETTE_COMPENSATION 0x00002003
  47. #define GD_AAA_STATISTICS_SETUP 0x00002004
  48. #define GD_LUMA_SHARPEN_SETUP 0x00002005
  49. #define GD_RGB_TO_RGB_SETUP 0x00002006
  50. #define GD_RGB_TO_YUV_SETUP 0x00002007
  51. #define GD_GAMMA_CURVE_LOOKUP 0x00002008
  52. #define GD_NOISE_FILTER_SETUP 0x00002009
  53. #define GD_BAD_PIXEL_CORRECT_SETUP 0x0000200A
  54. #define GD_VID_FADE_IN_OUT_SETUP 0x0000200B
  55. #define GD_CFA_DOMAIN_LEAKAGE_FILTER 0x0000200C
  56. #define GD_MCTF_MV_STAB_SETUP 0x0000200D
  57. #define GD_SET_SLOW_SHUT_UP_SAMPL_RT 0x0000200E
  58. #define GD_SET_REPEAT_FRM 0x0000200F
  59. #define GD_MCTF_GMV_SETUP 0x00002010
  60. #define GD_DIS_SETUP 0x00002011 //This command is used to setup the DIS algorithm paramete and related debug stuff.
  61. #define GD_SET_VIN_CAPTURE_WIN 0x00002100
  62. #define GD_AMPLIFIER_LINEARIZATION 0x00002101
  63. #define GD_PIXEL_SHUFFLE 0x00002102
  64. #define GD_BLACK_LEVEL_CORRECTION_CONFIG 0x00002103
  65. #define GD_BLACK_LEVEL_STATE_TABLES 0x00002104
  66. #define GD_BLACK_LEVEL_DETECTION_WINDOW 0x00002105
  67. #define GD_FIXED_PATTERN_NOISE_CORRECTION 0x00002106
  68. #define GD_CFA_NOISE_FILTER_INFO 0x00002107
  69. #define GD_DIGITAL_GAIN_SATURATION_LEVEL 0x00002108
  70. #define GD_LOCAL_EXPOSURE 0x00002109
  71. #define GD_DEMOASIC_FILTER 0x0000210A
  72. #define GD_RGB_NOISE_FILTER 0x0000210B
  73. #define GD_COLOR_CORRECTION 0x0000210C
  74. #define GD_CHROMA_MEDIAN_FILTER_INFO 0x0000210D
  75. #define GD_CHROMA_SCALE 0x0000210E
  76. #define GD_LUMA_SHARPENING 0x0000210F
  77. #define GD_AAA_STATISTICS_SETUP1 0x00002110
  78. #define GD_AAA_STATISTICS_SETUP2 0x00002111
  79. #define GD_AAA_PSEUDO_Y_SETUP 0x00002112
  80. #define GD_AAA_HISTORGRAM_SETUP 0x00002113
  81. #define GD_RAW_COMPRESSION 0x00002114
  82. #define GD_RAW_DECOMPRESSION 0x00002115
  83. #define GD_ROLLING_SHUTTER_COMPENSATION 0x00002116
  84. #define GD_SET_ZOOM_FACTOR 0x00002117
  85. #define GD_AAA_STATISTICS_SETUP3 0x00002118
  86. #define GD_VIDEO_PREVIEW_SETUP 0x00002119
  87. #define GD_VIN_RESET 0x0000211A
  88. #define GD_ANTI_ALIASING 0x0000211B
  89. #define GD_FPN_CALIBRATION 0x0000211C
  90. #define GD_BLACK_LEVEL_GLOBAL_OFFSET 0x0000211D
  91. #define GD_RGB_DIRECTIONAL_FILTER 0x0000211E
  92. #define GD_HDR_MIXER 0x0000211F
  93. #define GD_LUMA_SHARPENING_LINEARIZATION 0x00002120
  94. #define GD_LUMA_SHARPENING_FIR_CONFIG 0x00002121
  95. #define GD_LUMA_SHARPENING_LNL 0x00002122
  96. #define GD_LUMA_SHARPENING_TONE 0x00002123
  97. #define GD_MULTI_STREAM_VIDEO_PREVIEW 0x00002124
  98. #define GD_ENA_SECOND_STREAM_ENCODE 0x00002125
  99. #define GD_SET_ALPHA_CHANNEL 0x00002126
  100. #define GD_MODIFY_FRAME_BUFFER 0x00002127
  101. #define GD_SET_ACT_WIN_CENTER 0x00002128
  102. #define GD_SET_WARP_CONTROL 0x00002129
  103. #define GD_EARLY_WB_GAIN 0x0000212A
  104. #define GD_LUMA_SHARPENING_EDGE_CONTROL 0x00002130
  105. #define GD_LUMA_SHARPENING_BLEND_CONTROL 0x00002131
  106. #define GD_LUMA_SHARPENING_LEVEL_CONTROL 0x00002132
  107. #define GD_LUMA_SHARPENING_MISC_CONTROL 0x00002133
  108. #define GD_AAA_EARLY_WB_GAIN 0x00002134
  109. // H264/JPEG encoding mode commands
  110. #define GD_VIDEO_PREPROCESSING 0x00003001
  111. #define GD_FAST_AAA_CAPTURE 0x00003002
  112. #define GD_H264_ENCODE 0x00003004
  113. #define GD_H264_ENCODE_FROM_MEMORY 0x00003005
  114. #define GD_H264_BITS_FIFO_UPDATE 0x00003006
  115. #define GD_ENCODING_STOP 0x00003007
  116. #define GD_MODIFY_CMD_DLY 0x00003008
  117. #define GD_STILL_CAPTURE 0x00004001
  118. #define GD_JPEG_ENCODE_RESCALE_FROM_MEMORY 0x00004002
  119. #define GD_JPEG_BITS_FIFO_UPDATE 0x00004003
  120. #define GD_FREE_RAW_YUV_PIC_BUFFER 0x00004004
  121. #define GD_JPEG_RAW_YUV_STOP 0x00004005
  122. #define GD_MJPEG_ENCODE 0x00004006
  123. #define GD_VID_FADE_IN_OUT 0x00004007
  124. #define GD_MJPEG_ENCODE_WITH_H264 0x00004008
  125. #define GD_OSD_INSERT 0x00004009
  126. #define GD_YUV422_CAPTURE 0x00004010
  127. #define GD_SEND_CAVLC_RESULT 0x00004011
  128. #define GD_STILL_CAPTURE_IN_REC 0x00004012 // Z.ZHOU added for still capture during active recording
  129. #define GD_OSD_BLEND 0x00004013
  130. #define GD_INTERVAL_CAPTURE 0x00004014
  131. #define GD_STILL_CAPTURE_ADV 0x00004015
  132. /* H264/JPEG decode mode commnads */
  133. #define GD_H264_DECODE 0x00005002
  134. #define GD_JPEG_DECODE 0x00005003
  135. #define GD_RAW_PICTURE_DECODE 0x00005004
  136. #define GD_RESCALE_POSTPROCESSING 0x00005005
  137. #define GD_H264_DECODE_BITS_FIFO_UPDATE 0x00005006
  138. #define GD_H264_PLAYBACK_SPEED 0x00005007
  139. #define GD_H264_TRICKPLAY 0x00005008
  140. #define GD_DECODE_STOP 0x00005009
  141. #define GD_MULTI_SCENE_DECODE 0x00005010
  142. #define GD_CAPTURE_VIDEO_PICTURE 0x00005011
  143. #define GD_CAPTURE_STILL_PICTURE 0x00005012
  144. #define GD_JPEG_FREEZE 0x00005013
  145. #define GD_MULTI_SCENE_SETUP 0x00005014
  146. #define GD_MULTI_SCENE_DECODE_ADV 0x00005015
  147. #define GD_JPEG_DECODE_THUMBNAIL_WARP 0x00005016
  148. #define GD_MULTI_SCENE_DECODE_ADV_2 0x00005017
  149. /* IP CAM commands */
  150. #define GD_IPCAM_VIDEO_PREPROCESSING 0x00006001
  151. #define GD_IPCAM_VIDEO_CAPTURE_PREVIEW_SIZE_SETUP 0x00006002
  152. #define GD_IPCAM_VIDEO_ENCODE_SIZE_SETUP 0x00006003
  153. #define GD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP 0x00006004
  154. #define GD_IPCAM_VIDEO_FORCED_IDR 0x00006005
  155. #define GD_IPCAM_VIDEO_SYSTEM_SETUP 0x00006006
  156. #define GD_IPCAM_OSD_INSERT 0x00006007
  157. #define GD_IPCAM_SET_PRIVACY_MASK 0x00006008
  158. #define GD_IPCAM_QP_RATIO 0x00006009
  159. /* VOUT commands */
  160. #define GD_VOUT_MIXER_SETUP 0x00007001
  161. #define GD_VOUT_VIDEO_SETUP 0x00007002
  162. #define GD_VOUT_DEFAULT_IMG_SETUP 0x00007003
  163. #define GD_VOUT_OSD_SETUP 0x00007004
  164. #define GD_VOUT_OSD_BUFFER_SETUP 0x00007005
  165. #define GD_VOUT_OSD_CLUT_SETUP 0x00007006
  166. #define GD_VOUT_DISPLAY_SETUP 0x00007007
  167. #define GD_VOUT_DVE_SETUP 0x00007008
  168. #define GD_VOUT_RESET 0x00007009
  169. #define GD_VOUT_DISPLAY_CSC_SETUP 0x0000700A
  170. #define GD_VOUT_DIGITAL_OUTPUT_MODE_SETUP 0x0000700B
  171. /*
  172. * These GD_* commands are for experimental use only
  173. */
  174. #define GD_CFA_NOISE_FILTER 0x0000f001
  175. #define GD_DIGITAL_GAIN_SATURATION 0x0000f002
  176. #define GD_CHROMA_MEDIAN_FILTER 0x0000f003
  177. #define GD_LUMA_DIRECTIONAL_FILTER 0x0000f004
  178. #define GD_LUMA_SHARPEN 0x0000f005
  179. #define GD_MAIN_RESAMPLER_BANDWIDTH 0x0000f006
  180. #define GD_CFA_RESAMPLER_BANDWIDTH 0x0000f007
  181. #define GD_DSP_DEBUG_0 0x0000ff00
  182. #define GD_DSP_DEBUG_1 0x0000ff01
  183. #define GD_AAA_STATISTICS_DEBUG 0x0000ff02
  184. #define GD_DSP_SPECIAL 0x0000ff03
  185. #define GD_AAA_STATISTICS_DEBUG1 0x0000ff04
  186. #define GD_AAA_STATISTICS_DEBUG2 0x0000ff05
  187. #define GD_BAD_PIXEL_CROP 0x0000ff06
  188. #define GD_DSP_DEBUG_2 0x0000ff07
  189. #define GD_DSP_DEBUG_3 0x0000ff08
  190. #define GD_UPDATE_IDSP_CONFIG 0x0000ff09
  191. #define GD_REAL_TIME_RATE_MODIFY 0x0000ff0a
  192. #define GD_STOP_FATAL_UCODE 0x0000ffa0
  193. #define GD_CMD_MSG_CMD_ID(cmd_code) (((cmd_code)&0xffffff))
  194. // cmd_code: 0x00001002 GD_H264_ENCODING_SETUP
  195. #define GD_H264_ENCODER_SETUP_GET_CHAN_ID(cmd_code) (((cmd_code)>>24)&0x1f)
  196. #define GD_H264_ENCODER_SETUP_GET_STREAM_ID(cmd_code) ((cmd_code)>>30)
  197. #define GD_PRIMARY_STREAM (0)
  198. #define GD_SECONDARY_STREAM (1)
  199. #define GD_NUM_PIC_TYPES (3)
  200. // U8 quality;
  201. #define GD_QLEVEL_MASK (0x1f)
  202. #define GD_LEVEL_MASK (0xE0)
  203. #define GD_SIMPLE_GOP (0)
  204. #define GD_P2B2REF_GOP (1)
  205. #define GD_P2B3REF_GOP (2)
  206. #define GD_P2B3_ADV_GOP (3)
  207. #define GD_HI_GOP_DRAM (4)
  208. #define GD_HI_GOP_SMEM (5)
  209. #define GD_NON_REF_P_GOP (6)
  210. #define GD_HI_P_GOP (7)
  211. // cmd_code: 0x0000100B GD_SYSTEM_SETUP_INFO
  212. #define GD_CAMCORDER_APP_MODE 0
  213. #define GD_IP_CAMCORDER_APP_MODE 2
  214. // cmd_code: 0x0000100D GD_DSP_DEBUG_LEVEL_SETUP
  215. // U8 debug_level;
  216. #define GD_CODING_ORC_THREAD_0_PRINTF_DISABLE 0x1
  217. #define GD_CODING_ORC_THREAD_1_PRINTF_DISABLE 0x2
  218. #define GD_CODING_ORC_THREAD_2_PRINTF_DISABLE 0x4
  219. #define GD_CODING_ORC_THREAD_3_PRINTF_DISABLE 0x8
  220. // cmd_code: 0x0000100E GD_SYSTEM_PARAMETERS_SETUP
  221. // U32 audio_clk_freq;
  222. #define GD_AUDIO_CLK_12_288_MHZ 12288000
  223. // cmd_code: 0x0000100F GD_SYSTEM_IDSP_FREQ_SETUP
  224. // U32 idsp_freq;
  225. #define GD_IDSP_FREQ_144_MHZ 144000000
  226. // cmd_code: 0x00002004 GD_AAA_STATISTICS_SETUP
  227. #define GD_AAA_FILTER_SELECT_BOTH 0
  228. #define GD_AAA_FILTER_SELECT_CFA 1
  229. #define GD_AAA_FILTER_SELECT_YUV 2
  230. // cmd_code: 0x00002009 GD_NOISE_FILTER_SETUP
  231. // U32 strength;
  232. #define GD_BAD_PIXEL_CORRECTION_ENABLE 0x00000001
  233. #define GD_LEAKAGE_FILTER_ENABLE 0x00000002
  234. #define GD_NOISE_FILTER_ENABLE 0x00000004
  235. #define GD_LOCAL_EXPOSURE_FILTER_ENABLE 0x00000008
  236. #define GD_DEMOSAIC_FILTER_ENABLE 0x00000010
  237. #define GD_JAGGED_FILTER_ENABLE 0x00000020
  238. #define GD_RGB_DIRECTIONAL_FILTER_ENABLE 0x00000040
  239. #define GD_SPECKLE_FILTER_ENABLE 0x00000080
  240. #define GD_REINTERPOLATE_FILTER_ENABLE 0x00000100
  241. #define GD_LUMA_SHARPENING_FILTER_ENABLE 0x00000200
  242. #define GD_CHROMA_SCALE_FILTER_ENABLE 0x00000400
  243. #define GD_CHROMA_MEDIAN_FILTER_ENABLE 0x00000800
  244. #define GD_BLACK_LEVEL_ENABLE 0x00001000
  245. #define GD_FPN_ENABLE 0x00002000
  246. #define GD_COLOR_CORRECTION_ENABLE 0x00004000
  247. #define GD_IMG_3A_ENABLE 0x00008000
  248. #define GD_AMPLIFIER_LINEARIZATION_ENABLE 0x00010000
  249. // cmd_code: 0x00002100 GD_SET_VIN_CAPTURE_WIN
  250. // GD_S_CTRL_REG
  251. // U16 data_edge :1;
  252. #define GD_DATA_VAL_RISING_EDGE 0
  253. #define GD_DATA_VAL_FALLING_EDGE 1
  254. // U16 mastSlav_mod:2;
  255. #define GD_MAS_SLAV_MOD_UND 0x0
  256. #define GD_SLAVE_MOD 0x1
  257. #define GD_MAS_MOD 0x2
  258. #define GD_MAS_SPECIAL 0x3
  259. // U16 emb_sync :1;
  260. #define GD_EMB_SYNC_IN_DATA 0x1
  261. // U16 emb_sync_mode:1;
  262. #define GD_EMB_SYNC_656 0x0
  263. #define GD_ALL_ZERO_IN_BLANK 0x1
  264. // U16 emb_sync_loc:2;
  265. #define GD_EMB_SYNC_IN_LOW_PIX 0x0
  266. #define GD_EMB_SYNC_IN_UP_PIX 0x1
  267. #define GD_EMB_SYNC_IN_BOTH 0x2
  268. // U16 vs_pol :1;
  269. #define GD_VSYNC_POL_ACT_H 0x0
  270. #define GD_VSYNC_POL_ACT_L 0x1
  271. // U16 hs_pol :1;
  272. #define GD_HSYNC_POL_ACT_H 0x0
  273. #define GD_HSYNC_POL_ACT_L 0x1
  274. // U16 sony_fld_mod:1;
  275. #define GD_FLD_MOD_NORMAL 0
  276. #define GD_FLD_MOD_SONY 1
  277. // GD_S_INPUT_CONFIG_REG
  278. // U16 pad_type
  279. #define GD_LVCMOS 0x0
  280. #define GD_LVDS 0x1
  281. // U16 data_rate
  282. #define GD_SDR 0x0
  283. #define GD_DDR 0x1
  284. // U16 :1;
  285. #define GD_ONE_PIX_WIDE 0
  286. #define GD_TWO_PIX_WIDE 1
  287. // U16 inp_src
  288. #define GD_LVDS_SRC 0x0
  289. #define GD_GPIO_SRC 0x1
  290. // U16 inp_src_ty
  291. #define GD_RGB_IN 0x0
  292. #define GD_YUV_IN 0x1
  293. // U16 yuv_inp_ord
  294. #define GD_CrYCbY_1PIX 0x0
  295. #define GD_CbYCrY_1PIX 0x1
  296. #define GD_YCrYCb_1PIX 0x2
  297. #define GD_YCbYCr_1PIX 0x3
  298. #define GD_YCrYCb_2PIX 0x0
  299. #define GD_YCbYCr_2PIX 0x1
  300. #define GD_CrYCbY_2PIX 0x2
  301. #define GD_CbYCrY_2PIX 0x3
  302. // cmd_code: 0x00002119 GD_VIDEO_PREVIEW_SETUP
  303. // U32 cmd_code;
  304. #define GD_PREVIEW_ID_A 0
  305. #define GD_PREVIEW_ID_B 1
  306. // cmd_code: 0x00002129 GD_SET_WARP_CONTROL
  307. // U32 warp_control;
  308. #define GD_WARP_CONTROL_DISABLE 0
  309. #define GD_WARP_CONTROL_ENABLE 1
  310. // cmd_code: 0x00003001 GD_VIDEO_PREPROCESSING
  311. #define GD_RGB_RAW 0
  312. #define GD_YUV_422_INTLC 1
  313. #define GD_YUV_422_PROG 2
  314. // U8 preview_format_A : 4;
  315. // U8 preview_format_B : 3;
  316. #define GD_PREVIEW_FORMAT_PROGRESS 0
  317. #define GD_PREVIEW_FORMAT_INTERLACE 1
  318. #define GD_PREVIEW_FORMAT_DEFAULT_IMAGE_PROGRESS 2
  319. #define GD_PREVIEW_FORMAT_DEFAULT_IMAGE_INTERLACE 3
  320. #define GD_PREVIEW_FORMAT_PROGRESS_TOP_FIELD 4
  321. #define GD_PREVIEW_FORMAT_PROGRESS_BOT_FIELD 5
  322. #define GD_PREVIEW_FORMAT_NO_OUTPUT 6
  323. // cmd_code: 0x00003007 GD_ENCODING_STOP
  324. // U32 stop_method;
  325. #define GD_H264_STOP_IMMEDIATELY 0
  326. #define GD_H264_STOP_ON_NEXT_IP 1
  327. #define GD_H264_STOP_ON_NEXT_I 2
  328. #define GD_H264_STOP_ON_NEXT_IDR 3
  329. #define GD_EMERG_STOP 0xff
  330. // cmd_code: 0x00004001 GD_STILL_CAPTURE
  331. #define GD_JPEG_OUTPUT_SELECT_MAIN_JPEG_BITS 0x1
  332. #define GD_JPEG_OUTPUT_SELECT_THUMB_JPEG_BITS 0x4
  333. #define GD_JPEG_OUTPUT_SELECT_MAIN_YUV 0x8
  334. #define GD_JPEG_OUTPUT_SELECT_PREVIEW_YUV 0x10
  335. // U8 still_process_mode;
  336. #define GD_STILL_PROCESS_MODE_NORMAL 0
  337. #define GD_STILL_PROCESS_MODE_HIGH_ISO 1
  338. #define GD_STILL_PROCESS_MODE_LOW_ISO 2
  339. // U8 yuv_proc_mode;
  340. #define GD_YUV_START_NO_CNTRL (0)
  341. #define GD_YUV_START_EXP_MODE (1)
  342. #define GD_YUV_START_SLW_MODE (2)
  343. #define GD_YUV_START_SLW_STATS_MODE (3)
  344. // cmd_code: 0x00004014 GD_INTERVAL_CAPTURE
  345. // U32 action;
  346. #define GD_CAP_IDLE (0)
  347. #define GD_CAP_INITIATE (1)
  348. #define GD_CAP_CAPTURE (2)
  349. #define GD_CAP_TERMINATE (3)
  350. // cmd_code: 0x00006008 GD_IPCAM_SET_PRIVACY_MASK
  351. // U8 Y;
  352. // U8 U;
  353. // U8 V;
  354. // use privacy mask to label a region to let MCTF to pass through it
  355. #define GD_PRIVACY_MASK_OFF 0
  356. #define GD_PRIVACY_MASK_ON 1
  357. #define GD_PRIVACY_MASK_LABEL_MCTF_PASS_THROUGH 2
  358. // Adding Macros defined in the interface between ARM and VDSP
  359. //following three configuration is predefined inside the coding module.
  360. //and shared between the ARM and DSP.
  361. //Used to describe the layout of the Coding CTX information in the DRAM sent from
  362. //ARM to DSP.
  363. #define GD_CTX_WIDTH (416)
  364. #define GD_I_CTX_SZ (52*GD_CTX_WIDTH)
  365. #define GD_FLD_CTX_OFS (104*GD_CTX_WIDTH)
  366. #define GD_CABAC_CTX_MEM_SIZE (GD_CTX_WIDTH*(104*2))
  367. #define GD_JPG_LU_HUFF_DRAM_SIZE (256)
  368. #define GD_PG_CH_HUFF_DRAM_SIZE (256)
  369. #define GD_MCTF_CFG_SZ (22528)
  370. //*****************************************************************************
  371. //*****************************************************************************
  372. //** Enumerated types
  373. //*****************************************************************************
  374. //*****************************************************************************
  375. typedef enum
  376. {
  377. GD_IDSP_CMD_SEC1_VIN = GD_IDSP_SECTION_FILTER(1, 0),
  378. GD_IDSP_CMD_SEC1_AML = GD_IDSP_SECTION_FILTER(1, 1),
  379. GD_IDSP_CMD_SEC1_RLC = GD_IDSP_SECTION_FILTER(1, 2),
  380. GD_IDSP_CMD_SEC1_SMM = GD_IDSP_SECTION_FILTER(1,14),
  381. GD_IDSP_CMD_SEC1_SMT = GD_IDSP_SECTION_FILTER(1,15),
  382. GD_IDSP_CMD_SEC2_BFN = GD_IDSP_SECTION_FILTER(2, 0),
  383. GD_IDSP_CMD_SEC2_BPC = GD_IDSP_SECTION_FILTER(2, 1),
  384. GD_IDSP_CMD_SEC2_PSC = GD_IDSP_SECTION_FILTER(2, 2),
  385. GD_IDSP_CMD_SEC2_AAC = GD_IDSP_SECTION_FILTER(2, 3),
  386. GD_IDSP_CMD_SEC2_DGN = GD_IDSP_SECTION_FILTER(2, 4),
  387. GD_IDSP_CMD_SEC2_LEA = GD_IDSP_SECTION_FILTER(2, 5),
  388. GD_IDSP_CMD_SEC2_DMS = GD_IDSP_SECTION_FILTER(2, 6),
  389. GD_IDSP_CMD_SEC2_CLC = GD_IDSP_SECTION_FILTER(2, 7),
  390. GD_IDSP_CMD_SEC2_AAA = GD_IDSP_SECTION_FILTER(2, 8),
  391. GD_IDSP_CMD_SEC2_RYC = GD_IDSP_SECTION_FILTER(2, 9),
  392. GD_IDSP_CMD_SEC2_LSH = GD_IDSP_SECTION_FILTER(2,10),
  393. GD_IDSP_CMD_SEC2_CMN = GD_IDSP_SECTION_FILTER(2,11),
  394. GD_IDSP_CMD_SEC2_CDS = GD_IDSP_SECTION_FILTER(2,12),
  395. GD_IDSP_CMD_SEC2_LRS = GD_IDSP_SECTION_FILTER(2,13),
  396. GD_IDSP_CMD_SEC2_CRS = GD_IDSP_SECTION_FILTER(2,14),
  397. GD_IDSP_CMD_SEC2_MRS = GD_IDSP_SECTION_FILTER(2,15),
  398. GD_IDSP_CMD_SEC3_VWP = GD_IDSP_SECTION_FILTER(3, 0),
  399. GD_IDSP_CMD_SEC4_MVU = GD_IDSP_SECTION_FILTER(4, 0),
  400. GD_IDSP_CMD_SEC5_LPA = GD_IDSP_SECTION_FILTER(5, 0),
  401. GD_IDSP_CMD_SEC5_CPA = GD_IDSP_SECTION_FILTER(5, 1),
  402. GD_IDSP_CMD_SEC5_LDA = GD_IDSP_SECTION_FILTER(5, 2),
  403. GD_IDSP_CMD_SEC5_CDA = GD_IDSP_SECTION_FILTER(5, 3),
  404. GD_IDSP_CMD_SEC6_LPB = GD_IDSP_SECTION_FILTER(6, 0),
  405. GD_IDSP_CMD_SEC6_CPB = GD_IDSP_SECTION_FILTER(6, 1),
  406. GD_IDSP_CMD_SEC7_LPC = GD_IDSP_SECTION_FILTER(7, 0),
  407. GD_IDSP_CMD_SEC7_CPC = GD_IDSP_SECTION_FILTER(7, 1),
  408. GD_IDSP_CMD_SEC7_LDC = GD_IDSP_SECTION_FILTER(7, 2),
  409. GD_IDSP_CMD_SEC7_CDC = GD_IDSP_SECTION_FILTER(7, 3),
  410. GD_IDSP_CMD_SEC7_MRC = GD_IDSP_SECTION_FILTER(7, 4),
  411. }GD_IDSP_SECTION_FILTER_E;
  412. typedef enum
  413. {
  414. GD_IDSP_CMD_SECTION_DATA_BIT_UNIT,
  415. GD_IDSP_CMD_SECTION_DATA_BYTE_UNIT,
  416. GD_IDSP_CMD_SECTION_DATA_WORD_UNIT,
  417. GD_IDSP_CMD_SECTION_DATA_DOUBLE_UNIT,
  418. }GD_IDSP_CMD_DATA_UNIT_E;
  419. typedef enum
  420. {
  421. GD_IDSP_CMD_FILTER_UNKNOW,
  422. GD_IDSP_CMD_FILTER_VIDEO_IN,
  423. }GD_IDSP_CMD_FILTER_E;
  424. typedef enum
  425. {
  426. GD_IDSP_CMD_REG_FILTER_DEF_OFFSET,
  427. GD_IDSP_CMD_REG_FILTER_DEF_START_BIT,
  428. GD_IDSP_CMD_REG_FILTER_DEF_NUM_BITS,
  429. GD_IDSP_CMD_REG_FILTER_DEF_NUM_REGISTERS,
  430. GD_IDSP_CMD_REG_FILTER_DEF_DATA_UNIT,
  431. GD_IDSP_CMD_REG_FILTER_DEF_FILTER,
  432. }GD_IDSP_CMD_REG_FILTER_DEF_E;
  433. typedef enum
  434. {
  435. GD_JPEG_THUMB,
  436. GD_H264_I_ONLY,
  437. GD_RAW_PIC,
  438. GD_YUV_PIC,
  439. GD_JPEG_MAIN,
  440. } GD_DSP_CMD_SCENE_TYPE_E;
  441. typedef enum
  442. {
  443. GD_NORMAL,
  444. GD_FLIPPING_BLOCK,
  445. GD_FLIPPING_PAGE,
  446. GD_ALBUM_MIRROR,
  447. } GD_DSP_CMD_EFFECT_TYPE_E;
  448. typedef enum
  449. {
  450. GD_SMALL_SIZE,
  451. GD_LARGE_SIZE,
  452. } GD_DSP_CMD_THUMBNAIL_TYPE_E;
  453. typedef enum
  454. {
  455. GD_VOUT_ID_A = 0,
  456. GD_VOUT_ID_B = 1,
  457. } GD_DSP_CMD_VOUT_ID_E;
  458. typedef enum
  459. {
  460. GD_VOUT_SRC_DEFAULT_IMG = 0,
  461. GD_VOUT_SRC_BACKGROUND = 1,
  462. GD_VOUT_SRC_ENC = 2,
  463. GD_VOUT_SRC_DEC = 3,
  464. GD_VOUT_SRC_H264_DEC = 3,
  465. GD_VOUT_SRC_MPEG2_DEC = 5,
  466. GD_VOUT_SRC_MPEG4_DEC = 6,
  467. GD_VOUT_SRC_MIXER_A = 7,
  468. GD_VOUT_SRC_VCAP = 8,
  469. } GD_DSP_CMD_VOUT_SRC_E;
  470. typedef enum
  471. {
  472. GD_VOUT_DATA_SRC_NORMAL = 0,
  473. GD_VOUT_DATA_SRC_DRAM = 1,
  474. } GD_DSP_CMD_VOUT_DATA_SRC_E;
  475. typedef enum
  476. {
  477. GD_OSD_SRC_MAPPED_IN = 0,
  478. GD_OSD_SRC_DIRECT_IN = 1,
  479. } GD_DSP_CMD_OSD_SRC_E;
  480. typedef enum
  481. {
  482. GD_OSD_MODE_UYV565 = 0,
  483. GD_OSD_MODE_AYUV4444 = 1,
  484. GD_OSD_MODE_AYUV1555 = 2,
  485. GD_OSD_MODE_YUV1555 = 3,
  486. } GD_DSP_CMD_OSD_DIR_MODE_E;
  487. typedef enum
  488. {
  489. GD_CSC_DIGITAL = 0,
  490. GD_CSC_ANALOG = 1,
  491. GD_CSC_HDMI = 2,
  492. } GD_DSP_CMD_CSC_TYPE_E;
  493. /* return value for chip_id_ptr in GD_DSP_INIT_DATA_S */
  494. typedef enum
  495. {
  496. GD_CHIP_ID_UNKNOWN = -1,
  497. GD_CHIP_ID_33 = 0,
  498. GD_CHIP_ID_55 = 1,
  499. GD_CHIP_ID_66 = 2,
  500. GD_CHIP_ID_70 = 3,
  501. GD_CHIP_ID_88 = 4,
  502. GD_CHIP_ID_99 = 5,
  503. } GD_CHIP_ID_S;
  504. typedef enum
  505. {
  506. GD_AUDIO_SF_reserved = 0,
  507. GD_AUDIO_SF_96000,
  508. GD_AUDIO_SF_48000,
  509. GD_AUDIO_SF_44100,
  510. GD_AUDIO_SF_32000,
  511. GD_AUDIO_SF_24000,
  512. GD_AUDIO_SF_22050,
  513. GD_AUDIO_SF_16000,
  514. GD_AUDIO_SF_12000,
  515. GD_AUDIO_SF_11025,
  516. GD_AUDIO_SF_8000,
  517. } GD_AUDIO_IN_FREQ_E;
  518. //*****************************************************************************
  519. //*****************************************************************************
  520. //** Data Structures
  521. //*****************************************************************************
  522. //*****************************************************************************
  523. typedef struct
  524. {
  525. U64 cmd[4];
  526. }GD_IDSP_CMD_SECTION_S;
  527. typedef struct
  528. {
  529. // Dword #0
  530. U64 config_chan : 8;
  531. U64 res0_1 : 14;
  532. U64 config_pri : 2;
  533. U64 config_en : 8;
  534. U64 res0_2 : 31;
  535. U64 keep_prev_cfg : 1;
  536. // Dword #1
  537. U64 res1_1 ;
  538. // Dword #2
  539. U64 out_en : 3;
  540. U64 res2_1 : 5;
  541. U64 out_line_sync_type : 2;
  542. U64 out_line_sync_cnt_log2 : 3;
  543. U64 out_line_sync_cnt : 6;
  544. U64 out_str_credits : 6;
  545. U64 out_frm_sync_en : 1;
  546. U64 out_frm_sync_cnt : 6;
  547. U64 out_vin_sync_en : 1;
  548. U64 out_vin_sync_cnt : 6;
  549. U64 res2_2 : 25;
  550. // Dword #3
  551. U64 out_sreg_1 : 8;
  552. U64 out_pri_1 : 2;
  553. U64 out_sreg_2 : 8;
  554. U64 out_pri_2 : 2;
  555. U64 reserved3_1 : 44;
  556. }GD_IDSP_CMD_SEC_1_S;
  557. typedef struct {
  558. // Dword #0
  559. U64 config_chan : 8;
  560. U64 res0_1 : 14;
  561. U64 config_pri : 2;
  562. U64 config_en : 8;
  563. U64 filter_bypass_en : 8;
  564. U64 preview_mode : 4;
  565. U64 res0_2 : 19;
  566. U64 keep_prev_cfg : 1;
  567. // Dword #1
  568. U64 in_src : 2;
  569. U64 res1_1 : 1;
  570. U64 low_noise_luma : 1;
  571. U64 in_Sync_type : 2;
  572. U64 in_sync_dec : 1;
  573. U64 in_line_sync_cnt_log2 : 3;
  574. U64 in_sync_cnt_nbr : 6;
  575. U64 in_main_sreg : 8;
  576. U64 in_main_pri : 2;
  577. U64 in_chroma_sreg : 8;
  578. U64 in_chroma_pri : 2;
  579. U64 in_blk_sreg : 8;
  580. U64 in_blk_pri : 2;
  581. U64 in_sharpening_sreg : 8;
  582. U64 in_sharpening_pri : 2;
  583. U64 res1_2 : 8;
  584. // Dword #2
  585. U64 out_en : 8;
  586. U64 out_line_sync_type : 2;
  587. U64 out_line_sync_cnt_log2 : 3;
  588. U64 out_line_sync_cnt : 6;
  589. U64 out_str_credits : 6;
  590. U64 out_frm_sync_en : 1;
  591. U64 out_frm_sync_cnt : 6;
  592. U64 out_sec_sync_en : 1;
  593. U64 out_sec_sync_cnt : 6;
  594. U64 res2_1 : 1;
  595. U64 out_3rd_sync_en : 1;
  596. U64 out_3rd_sync_cnt : 6;
  597. U64 res2_3 : 16;
  598. U64 out_ext_src : 1;
  599. // Dword #3
  600. U64 out_main_luma_sreg : 8;
  601. U64 out_main_luma_pri : 2;
  602. U64 out_main_chroma_sreg : 8;
  603. U64 out_main_chroma_pri : 2;
  604. U64 out_me_sreg : 8;
  605. U64 out_me_pri : 2;
  606. U64 out_aaa_cfa_sreg : 8;
  607. U64 out_aaa_cfa_pri : 2;
  608. U64 out_aaa_rgb_sreg : 8;
  609. U64 out_aaa_rgb_pri : 2;
  610. U64 out_ext_raw_sreg : 8;
  611. U64 out_ext_raw_pri : 2;
  612. U64 reserved3_1 : 4;
  613. }GD_IDSP_CMD_SEC_2_S;
  614. typedef struct
  615. {
  616. // Dword #0
  617. U64 config_chan : 8;
  618. U64 res0_1 : 14;
  619. U64 config_pri : 2;
  620. U64 config_en : 8;
  621. U64 res0_2 : 30;
  622. U64 lastFrame : 1;
  623. U64 keep_prev_cfg : 1;
  624. // Dword #1
  625. U64 in_src : 2;
  626. U64 res1_1 : 2;
  627. U64 in_Sync_type : 2;
  628. U64 in_sync_dec : 1;
  629. U64 in_line_sync_cnt_log2 : 3;
  630. U64 in_sync_cnt_nbr : 6;
  631. U64 in_sreg_1 : 8;
  632. U64 in_pri_1 : 2;
  633. U64 in_sreg_2 : 8;
  634. U64 in_pri_2 : 2;
  635. U64 res1_2 : 28;
  636. // Dword #2
  637. U64 out_en : 1;
  638. U64 res2_1 : 7;
  639. U64 out_line_sync_type : 2;
  640. U64 out_line_sync_cnt_log2 : 3;
  641. U64 out_line_sync_cnt : 6;
  642. U64 out_str_credits : 6;
  643. U64 out_frm_sync_en : 1;
  644. U64 out_frm_sync_cnt : 6;
  645. U64 res2_2 : 16;
  646. U64 out_mode420 : 1;
  647. U64 res2_3 : 15;
  648. // Dword #3
  649. U64 out_smem_reg_1 : 8;
  650. U64 out_pri_1 : 2;
  651. U64 out_smem_reg_2 : 8;
  652. U64 out_pri_2 : 2;
  653. U64 reserved3_1 : 44;
  654. }GD_IDSP_CMD_SEC_3_S;
  655. typedef struct
  656. {
  657. // Dword #0
  658. U64 config_chan : 8;
  659. U64 res0_1 : 14;
  660. U64 config_pri : 2;
  661. U64 res0_2 : 39;
  662. U64 keep_prev_cfg : 1;
  663. // Dword #1
  664. U64 in_src : 2;
  665. U64 res1_1 : 2;
  666. U64 in_Sync_type : 2;
  667. U64 in_sync_dec : 1;
  668. U64 in_line_sync_cnt_log2 : 3;
  669. U64 in_sync_cnt_nbr : 6;
  670. U64 in_sreg_1 : 8;
  671. U64 in_pri_1 : 2;
  672. U64 res1_2 : 38;
  673. // Dword #2
  674. U64 out_en : 1;
  675. U64 res2_1 : 7;
  676. U64 out_line_sync_type : 2;
  677. U64 out_line_sync_cnt_log2 : 3;
  678. U64 out_line_sync_cnt : 6;
  679. U64 out_str_credits : 6;
  680. U64 out_frm_sync_en : 1;
  681. U64 out_frm_sync_cnt : 6;
  682. U64 res2_2 : 32;
  683. // Dword #3
  684. U64 out_smem_reg_1 : 8;
  685. U64 out_pri_1 : 2;
  686. U64 reserved3_1 : 54;
  687. }GD_IDSP_CMD_SEC_4_S;
  688. typedef struct
  689. {
  690. // Dword #0
  691. U64 config_chan : 8;
  692. U64 res0_1 : 14;
  693. U64 config_pri : 2;
  694. U64 res0_2 : 39;
  695. U64 keep_prev_cfg : 1;
  696. // Dword #1
  697. U64 in_src : 2;
  698. U64 res1_1 : 2;
  699. U64 in_Sync_type : 2;
  700. U64 in_sync_dec : 1;
  701. U64 in_line_sync_cnt_log2 : 3;
  702. U64 in_sync_cnt_nbr : 6;
  703. U64 in_sreg_1 : 8;
  704. U64 in_pri_1 : 2;
  705. U64 in_sreg_2 : 8;
  706. U64 in_pri_2 : 2;
  707. U64 res1_2 : 28;
  708. // Dword #2
  709. U64 out_en : 1;
  710. U64 res2_1 : 7;
  711. U64 out_line_sync_type : 2;
  712. U64 out_line_sync_cnt_log2 : 3;
  713. U64 out_line_sync_cnt : 6;
  714. U64 out_str_credits : 6;
  715. U64 out_frm_sync_en : 1;
  716. U64 out_frm_sync_cnt : 6;
  717. U64 res2_2 : 32;
  718. // Dword #3
  719. U64 out_smem_reg_1 : 8;
  720. U64 out_pri_1 : 2;
  721. U64 out_smem_reg_2 : 8;
  722. U64 out_pri_2 : 2;
  723. U64 reserved3_1 : 44;
  724. }GD_IDSP_CMD_SEC_5_S;
  725. typedef struct
  726. {
  727. // Dword #0
  728. U64 config_chan : 8;
  729. U64 res0_1 : 14;
  730. U64 config_pri : 2;
  731. U64 res0_2 : 39;
  732. U64 keep_prev_cfg : 1;
  733. // Dword #1
  734. U64 in_src : 2;
  735. U64 res1_1 : 2;
  736. U64 in_Sync_type : 2;
  737. U64 in_sync_dec : 1;
  738. U64 in_line_sync_cnt_log2 : 3;
  739. U64 in_sync_cnt_nbr : 6;
  740. U64 in_sreg_1 : 8;
  741. U64 in_pri_1 : 2;
  742. U64 in_sreg_2 : 8;
  743. U64 in_pri_2 : 2;
  744. U64 res1_2 : 28;
  745. // Dword #2
  746. U64 out_en : 1;
  747. U64 res2_1 : 7;
  748. U64 out_line_sync_type : 2;
  749. U64 out_line_sync_cnt_log2 : 3;
  750. U64 out_line_sync_cnt : 6;
  751. U64 out_str_credits : 6;
  752. U64 out_frm_sync_en : 1;
  753. U64 out_frm_sync_cnt : 6;
  754. U64 res2_2 : 32;
  755. // Dword #3
  756. U64 out_smem_reg_1 : 8;
  757. U64 out_pri_1 : 2;
  758. U64 out_smem_reg_2 : 8;
  759. U64 out_pri_2 : 2;
  760. U64 reserved3_1 : 44;
  761. }GD_IDSP_CMD_SEC_6_S;
  762. typedef struct
  763. {
  764. // Dword #0
  765. U64 config_chan : 8;
  766. U64 res0_1 : 14;
  767. U64 config_pri : 2;
  768. U64 res0_2 : 39;
  769. U64 keep_prev_cfg : 1;
  770. // Dword #1
  771. U64 in_src : 2;
  772. U64 res1_1 : 2;
  773. U64 in_Sync_type : 2;
  774. U64 in_sync_dec : 1;
  775. U64 in_line_sync_cnt_log2 : 3;
  776. U64 in_sync_cnt_nbr : 6;
  777. U64 in_sreg_1 : 8;
  778. U64 in_pri_1 : 2;
  779. U64 in_sreg_2 : 8;
  780. U64 in_pri_2 : 2;
  781. U64 res1_2 : 28;
  782. // Dword #2
  783. U64 out_en : 2;
  784. U64 res2_1 : 6;
  785. U64 out_line_sync_type : 2;
  786. U64 out_line_sync_cnt_log2 : 3;
  787. U64 out_line_sync_cnt : 6;
  788. U64 out_str_credits : 6;
  789. U64 out_frm_sync_en : 1;
  790. U64 out_frm_sync_cnt : 6;
  791. U64 res2_2 : 32;
  792. // Dword #3
  793. U64 out_smem_reg_1 : 8;
  794. U64 out_pri_1 : 2;
  795. U64 out_smem_reg_2 : 8;
  796. U64 out_pri_2 : 2;
  797. U64 out_smem_reg_3 : 8;
  798. U64 out_pri_3 : 2;
  799. U64 reserved3_1 : 34;
  800. }GD_IDSP_CMD_SEC_7_S;
  801. typedef union
  802. {
  803. GD_IDSP_CMD_SECTION_S sec;
  804. GD_IDSP_CMD_SEC_1_S sec1;
  805. GD_IDSP_CMD_SEC_2_S sec2;
  806. GD_IDSP_CMD_SEC_3_S sec3;
  807. GD_IDSP_CMD_SEC_4_S sec4;
  808. GD_IDSP_CMD_SEC_5_S sec5;
  809. GD_IDSP_CMD_SEC_6_S sec6;
  810. GD_IDSP_CMD_SEC_7_S sec7;
  811. }GD_IDSP_SEC_CMD_T;
  812. typedef struct
  813. {
  814. char name[100];
  815. U32 dwOffset; // 2bytes (xx*xx)
  816. U32 dwStartBit; // 2
  817. U32 dwBits; // 2
  818. U32 dwRegister; // xxxx
  819. GD_IDSP_CMD_DATA_UNIT_E eDataType; //
  820. GD_IDSP_CMD_FILTER_E eFilterType; //
  821. }GD_IDSP_CMD_REG_FILTER_DATA_S;
  822. typedef struct
  823. {
  824. GD_IDSP_CMD_REG_FILTER_DEF_E eDefType;
  825. char name[100];
  826. }GD_IDSP_CMD_REG_FILTER_DEF_S;
  827. typedef struct
  828. {
  829. char section[10];
  830. char filter[10];
  831. U32 offset;
  832. U32 reg_data_size;
  833. GD_IDSP_CMD_REG_FILTER_DATA_S* reg_data;
  834. }GD_IDSP_CMD_SEC_REG_FILTER_S;
  835. typedef struct
  836. {
  837. U32 Addr;
  838. U32 data;
  839. }GD_IDSP_CMD_SEC_REG_SET_DATA_S;
  840. typedef struct
  841. {
  842. char section[10];
  843. char filter[10];
  844. GD_IDSP_SECTION_FILTER_E control;
  845. U32 reg_data_size;
  846. GD_IDSP_CMD_SEC_REG_SET_DATA_S* reg_data;
  847. }GD_IDSP_CMD_SEC_REG_FILTER_DATS_S;
  848. typedef struct
  849. {
  850. // reg 0x00: 0x00
  851. U32 S_Control_reset : 1; // 0: no op 1: reset video in
  852. U32 S_Control_enable : 1; // 0: idle 1: enable video in
  853. U32 S_Control_win_en : 1; // enable capture window. automatic reset at the end of each capture
  854. U32 S_Control_data_edge : 1; // Data clock edge. 0: valid on rising edge of sensor clock
  855. // 1: valid on falling edge of sensor clock
  856. U32 S_Control_data_slave : 1; // slave mode enable: 0: disabled / 1: enabled
  857. U32 S_Control_data_master : 1; // master mode enable: 0: disabled / 1: enabled
  858. // Bit [5:4] forms the following combination:
  859. // 2b00: undefined
  860. // 2b01: slave mode
  861. // 2b10: master mode
  862. // 2b11: undefined
  863. U32 S_Control_data_emb_sync : 1; // sync code embedded in data. When set in master mode,
  864. // this indicates sensors have embedded sync code while
  865. // receiving seperate sync signals (Sony specific).
  866. U32 S_Control_data_emb_sync_mode : 1; // Embedded sync mode. 0: ITU-656 style(8-bit) 1: ITU-656 style(full data range)
  867. U32 S_Control_data_emb_sync_loc : 2; // Embedded sync code location (2-pixel wide input only).
  868. // 2b00: embedded sync code carried on the lower pixel
  869. // 2b01: embedded sync code carried on the upper pixel
  870. // 2b1x: embedded sync code carried on both pixels [should programed to 2b1x for serial sensor interface modes]
  871. U32 S_Control_data_vs_pol : 1; // vsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start)
  872. U32 S_Control_data_hs_pol : 1; // hsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start)
  873. U32 S_Control_data_field0_pol : 1; // 0: field 0 has ID set to 0 with wen assertion 1:field 0 has ID set to 1 with wen assertion
  874. U32 S_Control_data_sony_field_mode : 1; // 0: normal field mode 1: Sony-specific field mode. The first field of a multi-field readout in Sony CCD/TG is indicated by the state of EXP/ID pin at the first assertion of WEN/FLD
  875. U32 S_Control_data_ecc_enable : 1; // 656 error correction enable {including the sync code words in serial sensor mode]
  876. U32 S_Control_data_hsync_mask : 1; // 0: Toggle hsync during vertical blanking 1: No hsync toggle during vertical blanking
  877. U32 : 16; // reserved
  878. // reg 0x01: 0x04
  879. // input mode[4:0]
  880. U32 S_InputConfig_pad_type : 1; // 0: LVCMOS 1: LVDS
  881. U32 S_InputConfig_data_rate : 1; // 0: SDR 1: DDR
  882. U32 S_InputConfig_data_width : 1; // 0: 1-pixel wide 1: 2-pixel wide [should be programed to 1 (2-pixel wide) for serial sensor interface modes]
  883. U32 S_InputConfig_input_source : 1; // 0: from LVDS (lvds_idsp_sdata) 1: from GPIO (iopad_idsp_sdata). Input source and pad type forms three combinations:-LVDS source, LVDS pad.-LVDS source, LVCMOS pad.-GPIO source. (Pad type makes no difference.)
  884. U32 S_InputConfig_RGB_YUV : 1; // 0: RGB input 1: YUV input
  885. // The following are legal combinations for input mode (x: 0 or 1, -: no effect):
  886. // x000x:SDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[13:0]
  887. // x001x:DDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0]
  888. // x0100:SDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0]
  889. // x0110:DDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[55:0]
  890. // 110--:1-pixel wide YUV data, from iopad_idsp_sdata[7:0]
  891. // 111--:2-pixel wide YUV data, from iopad_idsp_sdata[15:0]
  892. U32 S_InputConfig_Source_pixel_data_width : 2; // Source pixel data width. VIN aligns all pixel values to MSB at output.
  893. // For example, 8-bit source means left shift by 6, 14-bit source means no shift,
  894. // etc. YUV data coming from GPIO must be 8-bit wide. (Hardware ignores the configuration.)
  895. // 2b00: 8-bit 2b01: 10-bit 2b10: 12-bit 2b11: 14-bit
  896. U32 S_InputConfig_YUV_input_order : 2; // YUV input order
  897. // For 1-pixel wide YUV data
  898. // 00:Cr,Y0,Cb,Y1,
  899. // 01:Cb,Y0,Cr,Y1,
  900. // 10:Y0,Cr,Y1,Cb,
  901. // 11:Y0,Cb,Y1,Cr,
  902. // For 2-pixel wide YUV data
  903. // 00:{Cr,Y},{Cb,Y},
  904. // 01:{Cb,Y},{Cr,Y},
  905. // 10:{Y,Cr},{Y,Cb},
  906. // 11: {Y, Cb}, {Y, Cr},
  907. U32 S_InputConfig_Number_of_active_SLVS_lanes : 2; // Number of active SLVS lanes
  908. // 2b00: 4 lanes; 2b01: 8 lanes; 2b10: 12 lanes; 2b11: 16 lanes)
  909. U32 S_InputConfig_Serial_sensor_interface_mode : 1; // Serial sensor interface mode (Micron and Sony)
  910. U32 S_InputConfig_Sony_serial_sensor_interface_mode : 1; // Sony serial sensor interface mode
  911. U32 S_InputConfig_VIN_clock_select : 1; // VIN clock select - use sensor or bit clock instead of IDSP clock
  912. U32 : 2; // reserved
  913. U32 : 16; // reserved
  914. // reg 0x02: 0x08
  915. // Status register: Write logic 1 to the status register clears the corresponding bit.
  916. U32 S_Status_vsync : 1; // begin of frame detected
  917. U32 S_Status_trig0 : 1; // trigger 0 status. 0: no trigger/ 1: triggered
  918. U32 S_Status_trig1 : 1; // trigger 1 status. 0: no trigger/ 1: triggered
  919. U32 S_Status_ovfl : 1; // synchronous FIFO overflow. 0: no overflow/ 1: overflow occurred
  920. U32 S_Status_shortl : 1; // early hsync detected
  921. U32 S_Status_shortf : 1; // early vsync detected
  922. U32 S_Status_field : 3; // current video field (read only).
  923. U32 S_Status_no_hsync : 1; // no hsync detected (time out)
  924. U32 S_Status_no_vsync : 1; // no vsync detected (time out)
  925. U32 S_Status_idsp_ahb_vsync : 1; // frame end signal to ARM
  926. U32 S_Status_idsp_ahb_mst_vsync : 1; // master mode frame end signal to ARM
  927. U32 S_Status_idsp_ahb_last_pxl : 1; // capture window end signal to ARM
  928. U32 S_Status_ecc_uncorrectable : 1; // uncorrectable 656 errors
  929. U32 S_Status_program_error : 1; // illegal programming detected. Currently the reported error includes:Master mode, active region exceeds frame region
  930. U32 : 16; // reserved
  931. // reg 0x03: 0x0C
  932. // Vertical active region width (master mode only)
  933. U32 S_Vwidth : 14; // vsync pulse width in unit of lines
  934. U32 : 2; // reserved
  935. U32 : 16; // reserved
  936. // reg 0x04: 0x10
  937. // Horizontal active region width (master mode only).
  938. U32 S_Hwidth : 14; // hsync pulse width in unit of pixels
  939. U32 : 2; // reserved
  940. U32 : 16; // reserved
  941. // reg 0x05: 0x14
  942. U32 S_Hoffset_top : 14; //
  943. U32 : 2; // reserved
  944. U32 : 16; // reserved
  945. // reg 0x06: 0x18
  946. U32 S_Hoffset_bot : 14; //
  947. U32 : 2; // reserved
  948. U32 : 16; // reserved
  949. // reg 0x07: 0x1C
  950. // Frame size, vertical (master mode only)
  951. U32 S_V : 14; // Number of lines per field
  952. U32 : 2; // reserved
  953. U32 : 16; // reserved
  954. // reg 0x08: 0x20
  955. // Frame size, horizontal (in master mode only)
  956. U32 S_H : 14; // Number of pixels per line
  957. U32 : 2; // reserved
  958. U32 : 16; // reserved
  959. // reg 0x09: 0x24
  960. // Minimum frame size, vertical (slave mode only)
  961. U32 S_MinV : 14; // number of lines per field
  962. U32 : 2; // reserved
  963. U32 : 16; // reserved
  964. // reg 0x0A: 0x28
  965. // Minimum frame size, horizontal (slave mode only)
  966. U32 S_MinH : 14; // number of pixels per line
  967. U32 : 2; // reserved
  968. U32 : 16; // reserved
  969. // reg 0x0B: 0x2C
  970. // Trigger 0 control
  971. U32 S_Trigger0Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame,
  972. // where n = startline (counting from 1st line active region)
  973. U32 S_Trigger0Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger
  974. U32 S_Trigger0Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled
  975. U32 : 16; // reserved
  976. // reg 0x0C: 0x30
  977. // Trigger 0 control
  978. U32 S_Trigger0End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame,
  979. // where n = lastline (counting from 1st line active region)
  980. U32 : 2; // reserved
  981. U32 : 16; // reserved
  982. // reg 0x0D: 0x34
  983. // Trigger 1 control
  984. U32 S_Trigger1Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame,
  985. // where n = startline (counting from 1st line active region)
  986. U32 S_Trigger1Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger
  987. U32 S_Trigger1Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled
  988. U32 : 16; // reserved
  989. // reg 0x0E: 0x38
  990. // Trigger 1 control
  991. U32 S_Trigger1End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame,
  992. // where n = lastline (counting from 1st line active region)
  993. U32 : 2; // reserved
  994. U32 : 16; // reserved
  995. // reg 0x0F: 0x3C
  996. // VOUT synchronization control
  997. U32 S_VoutStart0_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line,
  998. // where n = startline (counting from 1st line active region)
  999. U32 : 1; // reserved
  1000. U32 S_VoutStart0_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field
  1001. U32 : 16; // reserved
  1002. // reg 0x10: 0x40
  1003. // VOUT synchronization control
  1004. U32 S_VoutStart1_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line,
  1005. // where n = startline (counting from 1st line active region)
  1006. U32 : 1; // reserved
  1007. U32 S_VoutStart1_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field
  1008. U32 : 16; // reserved
  1009. // reg 0x11: 0x44
  1010. // Capture window control, vertical start
  1011. U32 S_CapStartV : 14; // Start vertical location of capture window
  1012. U32 : 2; // reserved
  1013. U32 : 16; // reserved
  1014. // reg 0x12: 0x48
  1015. // Capture window control, horizontal start
  1016. U32 S_CapStartH : 14; // Start horizontal location of capture window
  1017. // In 8 channel , Sony serial sensor mode, the capture window should start 4
  1018. // pixels after the SAV (i.e. exclude the 4 pixels added by the receiver at the
  1019. // beginning of every line which are not part of the original active line)
  1020. U32 : 2; // reserved
  1021. U32 : 16; // reserved
  1022. // reg 0x13: 0x4C
  1023. // Capture window control, vertical end
  1024. U32 S_CapEndV : 14; // End vertical location of capture window
  1025. U32 : 2; // reserved
  1026. U32 : 16; // reserved
  1027. // reg 0x14: 0x50
  1028. // Capture window control, horizontal end
  1029. U32 S_CapEndH : 14; // End horizontal location of capture window
  1030. // In 8 channel, Sony serial sensor mode, the capture window should end 4 pixels
  1031. // before the EAV sync code to exclude the additional sync code pixels.
  1032. U32 : 2; // reserved
  1033. U32 : 16; // reserved
  1034. // reg 0x15: 0x54
  1035. // All-zero embedded sync horizontal blank interval length
  1036. U32 S_BlankLengthH : 14; // Blank interval length in sensor clock cycles
  1037. U32 : 2; // reserved
  1038. U32 : 16; // reserved
  1039. // reg 0x16: 0x58
  1040. // Vsync timeout limit (lower 16 bits) and also EAV column for SLVS mode.
  1041. U32 S_TimeoutVLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels
  1042. U32 : 16; // reserved
  1043. // reg 0x17: 0x5C
  1044. // Vsync timeout limit (upper 16 bits)
  1045. U32 S_TimeoutVHigh : 16; //
  1046. U32 : 16; // reserved
  1047. // reg 0x18: 0x60
  1048. // Hsync timeout limit (lower 16 bits) and also Horizontal line length (SAV-to-SAV distance) in SLVS mode.
  1049. U32 S_TimeoutHLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels
  1050. U32 : 16; // reserved
  1051. // reg 0x19: 0x64
  1052. // Hsync timeout limit (lower 16 bits)
  1053. U32 S_TimeoutHHigh : 16; //
  1054. U32 : 16; // reserved
  1055. // reg 0x1A: 0x68
  1056. U32 S_mipi_cfg1 : 16; // Add
  1057. U32 : 16; // reserved
  1058. // reg 0x1B: 0x6C
  1059. U32 S_mipi_cfg2 : 16; // Add
  1060. U32 : 16; // reserved
  1061. // reg 0x1C: 0x70
  1062. U32 S_mipi_bdphyctl : 16; // Add
  1063. U32 : 16; // reserved
  1064. // reg 0x1D: 0x74
  1065. U32 S_mipi_sdphyctl : 16; // Add
  1066. U32 : 16; // reserved
  1067. // reg 0x1E: 0x78
  1068. U32 s_reserved0;
  1069. // reg 0x1F: 0x7C
  1070. U32 s_reserved1;
  1071. // reg 0x20: 0x80 RO
  1072. U32 S_debugFifoCount : 16; // Synchronous FIFO word count (debug only), number of words in synchronous FIFO
  1073. U32 : 16; // reserved
  1074. // reg 0x21: 0x84 RO
  1075. U32 S_debugFifoData0 : 16; // Synchronous FIFO read data (debug only), Pixel 0 read data
  1076. U32 : 16; // reserved
  1077. // reg 0x22: 0x88 RO
  1078. U32 S_debugFifoData1 : 16; // Synchronous FIFO read data (debug only), Pixel 1 read data
  1079. U32 : 16; // reserved
  1080. // reg 0x23: 0x8C RO
  1081. U32 S_debugStall : 16; // Stall (debug only), Output interface stall
  1082. U32 : 16; // reserved
  1083. // reg 0x24: 0x90 RO SLSV status (debug only), Output interface stall
  1084. U32 S_slvStatus_SLSV : 1; // receiver reached LOCK state
  1085. U32 S_slvStatus_sync : 1; // Detected sync code match on all 4 words.
  1086. U32 S_slvStatus_Start_Of_Frame : 1; // Detected Start-Of-Frame
  1087. U32 S_slvStatus_VSYNC : 1; // Detected VSYNC
  1088. U32 S_slvStatus_Start_of_line : 1; // Detected Start-of-line
  1089. U32 S_slvStatus_valid_pixel : 1; // Generated valid pixel output
  1090. U32 S_slvStatus_End_of_line : 1; // Generated an End-of-line output
  1091. U32 S_slvStatus_Corrected_error : 1; // Corrected error in sync code
  1092. U32 : 8; // reserved
  1093. U32 : 16; // reserved
  1094. // U32 s_reserved0[16]; // reg 0x1A-0x29
  1095. // U32 s_rsc_vertical_enable: 1; // reg 0x2A
  1096. // U32 s_rsc_horizontal_enable:1;
  1097. // U32 s_rsc_arm_int_enable:1;
  1098. // U32 s_rsc_reg_config_mask:1;
  1099. // U32 s_rsc_use_software_sample: 1;
  1100. // U32 s_reserved1:11;
  1101. // U32 s_rsc_correction_int_delay;// reg 0x2B
  1102. // U32 s_rsc_hor_software_gyro_sample; // reg 0x2C
  1103. // U32 s_rsc_hor_offset; // reg 0x2D
  1104. // U32 s_rsc_hor_scale; // reg 0x2E
  1105. // U32 s_rsc_vert_software_gyro_sample; // reg 0x2F
  1106. // U32 s_rsc_vert_offset; // reg 0x30
  1107. // U32 s_rsc_vert_scale; // reg 0x31
  1108. } GD_IDSP_VIN_REGS_S;
  1109. /**
  1110. * DSP_INIT_DATA contains initialization related parameters
  1111. * passed from ARM to DSP. The location is used to store a
  1112. * data structure that contains various buffer pointers and
  1113. * size information. 128 bytes for DSP_INIT_DATA
  1114. */
  1115. typedef struct
  1116. {
  1117. U32 *default_binary_data_ptr;
  1118. U32 *cmd_data_ptr;
  1119. U32 cmd_data_size;
  1120. U32 *result_queue_ptr;
  1121. U32 result_queue_size;
  1122. U32 reserved_1[3];
  1123. U32 operation_mode;
  1124. U32 *default_config_ptr;
  1125. U32 default_config_size;
  1126. U32 *DSP_buf_ptr;
  1127. U32 DSP_buf_size;
  1128. U32 *vdsp_info_ptr;
  1129. U32 *pjpeg_buf_ptr;
  1130. U32 pjpeg_buf_size;
  1131. U32 *chip_id_ptr;
  1132. U32 reserved_2;
  1133. U32 reserved_3[14];
  1134. } GD_DSP_INIT_DATA_S;
  1135. // Structure that indicate the vdsp interrupt status
  1136. typedef struct
  1137. {
  1138. U32 dsp_cmd_rx; // if DSP had read from cmd buf
  1139. U32 dsp_msg_tx; // if DSP had written to msg buf
  1140. U32 dsp_histogram_tx:1; //if DSP has send at least one histogram to ARM
  1141. U32 reserv:31;
  1142. U32 padding[5];
  1143. } GD_VDSP_INFO_S;
  1144. /**
  1145. * During H264/JPEG encoding mode, ARM will receive vin interrupt.
  1146. * ARM should copy video input polarity information to video input
  1147. * register area right after input interrupt is received.
  1148. */
  1149. typedef struct
  1150. {
  1151. U32 vin_shadow_register;
  1152. } GD_VIN_SHADOW_REGISTER_S;
  1153. /**
  1154. * The data structure are read by DSP at each video output frame.
  1155. * DSP reads the data structure after the DMA completion of the
  1156. * output data. ARM receives each Vout interrrupt at vsync
  1157. * rising edge.
  1158. */
  1159. typedef struct
  1160. {
  1161. U8 format;
  1162. U8 frame_rate;
  1163. U8 Audio_Sampling_Clock_Freq;
  1164. U8 Audio_Output_Clock_Freq;
  1165. U16 active_width;
  1166. U16 active_height;
  1167. U16 video_width;
  1168. U16 video_height;
  1169. U32 OSD0_addr;
  1170. U32 OSD1_addr;
  1171. U16 OSD0_width;
  1172. U16 OSD1_width;
  1173. U16 OSD0_height;
  1174. U16 OSD1_height;
  1175. U16 OSD0_pitch;
  1176. U16 OSD1_pitch;
  1177. U32 default_image_y_addr;
  1178. U32 default_image_u_addr;
  1179. U16 default_image_pitch;
  1180. U16 default_image_height;
  1181. U8 polarity;
  1182. U8 flip_control;
  1183. U8 reset;
  1184. U8 OSD_progressive;
  1185. } GD_VOUT_SETUP_DATA_S;
  1186. /**
  1187. * Binary data structure for encode mode
  1188. */
  1189. typedef struct
  1190. {
  1191. U32 magic_number;
  1192. U32 manufacture_id;
  1193. U32 uCode_version;
  1194. U32 dram_addr_idsp_default_cfg;
  1195. U32 dram_addr_luma_huf_tab;
  1196. U32 dram_addr_chroma_huf_tab;
  1197. U32 dram_addr_mctf_cfg_buffer;
  1198. U32 dram_addr_cabac_ctx_tab;
  1199. U32 dram_addr_jpeg_out_bit_buffer; //BSB start addr
  1200. U32 dram_addr_cabac_out_bit_buffer; //BSB start addr
  1201. U32 dram_addr_bit_info_buffer; //Bits INFO BUFFER addr
  1202. U32 jpeg_out_bit_buf_sz; //BSB size
  1203. U32 h264_out_bit_buf_sz; //BSB size
  1204. U32 bit_info_buf_sz; //Bits INFO BUFFER size
  1205. U32 mctf_cfg_buf_sz;
  1206. } GD_DEFAULT_ENC_BINARY_DATA_S;
  1207. /**
  1208. * Binary data structure for decode mode
  1209. */
  1210. typedef struct
  1211. {
  1212. U32 magic_number;
  1213. U32 manufacture_id;
  1214. U32 uCode_version;
  1215. U32 dram_addr_idsp_default_cfg;
  1216. U32 dram_addr_cabac_ctx_tab;
  1217. U32 dram_addr_cabac_out_bit_buffer_daddr;
  1218. U32 dram_addr_cabac_out_bit_buffer_size;
  1219. U32 still_picture_decode_buffer_daddr;
  1220. U32 still_picture_decode_buffer_size;
  1221. U32 h264_frame_buffer_daddr;
  1222. U32 h264_frame_buffer_size;
  1223. U32 still_frame_buffer_daddr;
  1224. U32 still_frame_buffer_size;
  1225. U32 still_frame_buffer_pitch;
  1226. U32 dram_addr_luma_huf_tab;
  1227. U32 dram_addr_chroma_huf_tab;
  1228. } GD_DEFAULT_DEC_BINARY_DATA_S;
  1229. /**
  1230. * DIS histogram information
  1231. */
  1232. typedef struct
  1233. {
  1234. U32 seq_nbr : 8;
  1235. U32 sem_id : 2;
  1236. U32 hist_x_precision_in_quater_pixel: 3;
  1237. U32 hist_y_precision_in_quater_pixel: 3;
  1238. U32 reserved : 16;
  1239. U32 hist_x_hist_max_item_nbr : 16; //For example, the range of the hist x dimension would be: 128: [-64,63]
  1240. U32 hist_y_hist_max_item_nbr : 16; //As above
  1241. // This one and the following one are used to specify the block area in the picture for the ME histogram
  1242. U32 hist_start_mb_nbr : 16;
  1243. U32 hist_total_mb_nbr : 16;
  1244. } GD_DIS_HIST_HEADER_S;
  1245. /*********************************************************************/
  1246. /* MESSAGE */
  1247. /**
  1248. * The length of a record is fixed at 128 bytes.
  1249. * DSP firmware continuously writes result record into the queue.
  1250. * ARM reads the result record out and both advance their buffer
  1251. * pointer. DSP doesn't handshake with ARM on result queue usage.
  1252. */
  1253. typedef struct
  1254. {
  1255. U32 time_stamp;
  1256. U32 frame_number;
  1257. U32 params[30];
  1258. } GD_DSP_RESULT_QUEUE_S;
  1259. /**
  1260. * H264/JPEG encoding message
  1261. */
  1262. typedef struct
  1263. {
  1264. U8 enable : 1;
  1265. U8 rsc_enable : 1;
  1266. U8 proc : 1;
  1267. U8 reserved : 5;
  1268. S8 x_angular_velocity;
  1269. S8 y_angular_velocity;
  1270. U8 max_angular_velocity;
  1271. } GD_DIS_STATUS_S;
  1272. typedef struct
  1273. {
  1274. U32 dsp_operation_mode;
  1275. U32 timecode;
  1276. U32 cmd_echo;
  1277. U32 num_cmds;
  1278. U32 aaa_data_fifo_next;
  1279. U32 aaa_data_fifo_size;
  1280. U32 h264_bits_fifo_next;
  1281. U32 h264_bits_fifo_size;
  1282. U32 h264_info_fifo_next;
  1283. U32 h264_info_fifo_size;
  1284. U32 jpeg_bits_fifo_next;
  1285. U32 jpeg_bits_fifo_size;
  1286. U32 jpeg_info_fifo_next;
  1287. U32 jpeg_info_fifo_size;
  1288. U32 raw_pic_addr;
  1289. U32 thumbnail_pic_y_addr;
  1290. U32 thumbnail_pic_uv_addr;
  1291. U32 thumbnail_pic_y_pitch;
  1292. U32 encode_y_pic_addr;
  1293. U32 encode_uv_pic_addr;
  1294. U32 encode_yuv_pitch;
  1295. U32 preview_y_pic_addr;
  1296. U32 preview_uv_pic_addr;
  1297. U32 preview_yuv_pitch;
  1298. U32 total_pic_encoded_h264_mode;
  1299. U32 total_pic_encoded_jpeg_mode;
  1300. U32 total_thumbnail_encoded_jpeg_mode;
  1301. U32 raw_cap_cnt;
  1302. U32 yuv_pic_cnt;
  1303. U32 encode_operation_mode;
  1304. U16 encode_state;
  1305. U16 capture_state;
  1306. U32 pts_val;
  1307. #define NO_ERROR 0
  1308. #define ILLEGAL_SIGNAL_1 1
  1309. U32 err_code;
  1310. U32 raw_pic_pitch;
  1311. U32 raw_pic_width;
  1312. U32 raw_pic_row;
  1313. U32 yuv_aaa_data_fifo_next;
  1314. U32 yuv_aaa_data_fifo_size;
  1315. U16 re_encode_state[4];
  1316. U32 pjpg_bitBuf_addr;
  1317. U32 pjpg_bitBuf_sz;
  1318. U32 total_screen_thumbnail_encoded_jpeg_mode;
  1319. U32 screen_thumbnail_pic_y_addr;
  1320. U32 screen_thumbnail_pic_uv_addr;
  1321. U32 total_pic_encoded_mjpeg_mode;
  1322. U32 main_me1_addr ;
  1323. U32 main_me1_pitch ;
  1324. U32 preview_c_me1_addr ;
  1325. U32 preview_c_me1_pitch ;
  1326. } GD_ENCODE_MSG_S;
  1327. /**
  1328. * H264/JPEG decoding message
  1329. */
  1330. typedef struct
  1331. {
  1332. U32 dsp_operation_mode;
  1333. U32 timecode;
  1334. U32 cmd_echo;
  1335. U32 num_cmds;
  1336. U32 main_yuv_address ;
  1337. U32 preview_c_yuv_address ;
  1338. U32 main_me1_address ;
  1339. U32 preview_c_me1_address ;
  1340. U16 main_yuv_pitch ;
  1341. U16 preview_c_pitch ;
  1342. U16 main_me1_pitch ;
  1343. U16 preview_c_me1_pitch ;
  1344. U32 stream_0_mv_address ;
  1345. U32 stream_1_mv_address ;
  1346. U32 stream_2_mv_address ;
  1347. U32 stream_3_mv_address ;
  1348. U32 stream_0_qp_address ;
  1349. U32 stream_1_qp_address ;
  1350. U32 stream_2_qp_address ;
  1351. U32 stream_3_qp_address ;
  1352. } GD_ENCODE_MSG_2_S ;
  1353. /**
  1354. * H264/JPEG decoding message
  1355. */
  1356. typedef struct
  1357. {
  1358. U32 dsp_operation_mode;
  1359. U32 timecode;
  1360. U32 cmd_echo;
  1361. U32 num_cmds;
  1362. U32 latest_clock_counter;
  1363. U32 latest_pts;
  1364. U32 jpeg_frame_count;
  1365. U32 yuv422_y_addr;
  1366. U32 yuv422_uv_addr;
  1367. U32 h264_bits_fifo_next;
  1368. U32 jpeg_bits_fifo_next;
  1369. U32 decode_state;
  1370. U32 error_status;
  1371. U32 total_error_count;
  1372. U32 decoded_pic_number;
  1373. U32 jpeg_thumbnail_size;
  1374. U32 jpeg_rescale_buf_pitch; /* pitch of scaled JPEG after decoding */
  1375. U16 jpeg_rescale_buf_width;
  1376. U16 jpeg_rescale_buf_height;
  1377. U32 jpeg_rescale_buf_address_y; /* Y address of scaled JPEG after decoding */
  1378. U32 jpeg_rescale_buf_address_uv;
  1379. U32 second_rescale_buf_pitch; /* pitch of scaled JPEG after decoding */
  1380. U16 second_rescale_buf_width;
  1381. U16 second_rescale_buf_height;
  1382. U32 second_rescale_buf_address_y; /* Y address of second scaled after decoding */
  1383. U32 second_rescale_buf_address_uv;
  1384. U32 jpeg_y_addr; /*Y address of decoded JPEG */
  1385. U32 jpeg_uv_addr;
  1386. U32 jpeg_pitch; /* DRAM pitch of decoded JPEG */
  1387. U32 jpeg_width; /* width of decoded JPEG */
  1388. U32 jpeg_height;
  1389. U32 jpeg_capture_count;
  1390. U32 jpeg_screennail_size;
  1391. U32 jpeg_thumbnail_buf_dbase; /*multi scene thumbnail buffer base address*/
  1392. U32 jpeg_thumbnail_buf_pitch; /*buffer pitch of each thumbnail buffer */
  1393. U32 jpeg_large_thumbnail_buf_dbase; /*multi scene large thumbnail buffer base address*/
  1394. U32 jpeg_large_thumbnail_buf_pitch; /*buffer pitch of each large thumbnail buffer */
  1395. U16 jpeg_cabac_message_queue_fullness; /* fullness of cabac message queue */
  1396. U16 jpeg_rescale_message_queue_fullness; /* fullness of rescale message queue */
  1397. } GD_DECODE_MSG_S;
  1398. typedef struct
  1399. {
  1400. U16 awb_tile_col_start;
  1401. U16 awb_tile_row_start;
  1402. U16 awb_tile_width;
  1403. U16 awb_tile_height;
  1404. U16 awb_tile_active_width;
  1405. U16 awb_tile_active_height;
  1406. U16 awb_rgb_shift;
  1407. U16 awb_y_shift;
  1408. U16 awb_min_max_shift;
  1409. U16 ae_tile_col_start;
  1410. U16 ae_tile_row_start;
  1411. U16 ae_tile_width;
  1412. U16 ae_tile_height;
  1413. U16 ae_y_shift;
  1414. U16 ae_linear_y_shift;
  1415. U16 af_tile_col_start;
  1416. U16 af_tile_row_start;
  1417. U16 af_tile_width;
  1418. U16 af_tile_height;
  1419. U16 af_tile_active_width;
  1420. U16 af_tile_active_height;
  1421. U16 af_y_shift;
  1422. U16 af_cfa_y_shift;
  1423. U8 awb_tile_num_col;
  1424. U8 awb_tile_num_row;
  1425. U8 ae_tile_num_col;
  1426. U8 ae_tile_num_row;
  1427. U8 af_tile_num_col;
  1428. U8 af_tile_num_row;
  1429. U8 total_slices_x;
  1430. U8 total_slices_y;
  1431. U8 slice_index_x;
  1432. U8 slice_index_y;
  1433. U16 slice_width;
  1434. U16 slice_height;
  1435. U16 slice_start_x;
  1436. U16 slice_start_y;
  1437. } GD_AAA_TILE_CONFIG_S;
  1438. /*-------------------------------------------------
  1439. * Configuration mode
  1440. * 1. Interrupt setup (0x00001001)
  1441. * 2. H264 encoding setup (0x00001002)
  1442. * 3. JPEG encoding setup (0x00001003)
  1443. * 4. H264 decoding setup (0x00001004)
  1444. * 5. JPEG decoding setup (0x00001005)
  1445. * 6. Reset operation (0x00001006)
  1446. * 7. Video output restart (0x00001007)
  1447. * 8. Encode timer operation (0x00001008)
  1448. * 9. Chip Selection (0x00001009)
  1449. * 10. HD echo setup (0x0000100A)
  1450. * 11. System setup info (0x0000100B)
  1451. * 12. EIS SWITCH VOUT (0x0000100C)
  1452. * 13. Debug level setup (0x0000100D)
  1453. * 14. Audio frequency setup (0x0000100E)
  1454. -------------------------------------------------*/
  1455. typedef struct
  1456. {
  1457. // cmd_code: 0x00001001 GD_INTERRUPT_SETUP
  1458. U32 cmd_code;
  1459. U8 vin_int;
  1460. U8 vout_int;
  1461. } GD_DSP_CMD_INTERRUPT_SETUP_S;
  1462. typedef struct
  1463. {
  1464. // cmd_code: 0x00001002 GD_H264_ENCODING_SETUP
  1465. U32 cmd_code;
  1466. U8 mode;
  1467. U8 M;
  1468. U8 N;
  1469. U8 quality;
  1470. U32 average_bitrate;
  1471. U32 vbr_cntl;
  1472. U32 vbr_setting : 8;
  1473. U32 allow_I_adv : 8;
  1474. U32 cpb_buf_idc : 8;
  1475. U32 en_panic_rc : 2;
  1476. U32 cpb_cmp_idc : 2; // cpb compliance idc
  1477. U32 fast_rc_idc : 4;
  1478. U32 target_storage_space;
  1479. U32 bits_fifo_base;
  1480. U32 bits_fifo_limit;
  1481. U32 info_fifo_base;
  1482. U32 info_fifo_limit;
  1483. U8 audio_in_freq;
  1484. U8 vin_frame_rate;
  1485. U8 encoder_frame_rate;
  1486. U8 frame_sync;
  1487. U16 initial_fade_in_gain;
  1488. U16 final_fade_out_gain;
  1489. U32 idr_interval;
  1490. U32 cpb_user_size;
  1491. U8 numRef_P;
  1492. U8 numRef_B;
  1493. U8 vin_frame_rate_ext;
  1494. U8 encoder_frame_rate_ext;
  1495. U32 pjpg_bits_fifo_base;
  1496. U32 pjpg_bits_fifo_limit;
  1497. U32 vbr_cbp_rate;
  1498. U32 frame_rate_division_factor : 8;
  1499. U32 force_intlc_tb_iframe : 1;
  1500. U32 session_id : 4;
  1501. U32 frame_rate_multiplication_factor: 8;
  1502. U32 hflip : 1;
  1503. U32 vflip : 1;
  1504. U32 rotate : 1;
  1505. U32 chroma_format : 1;
  1506. U32 reserved : 7;
  1507. U32 custom_encoder_frame_rate;
  1508. } GD_DSP_CMD_H264_ENCODE_SETUP_S, GD_DSP_CMD_VID_ENCODE_SETUP_S;
  1509. typedef struct
  1510. {
  1511. // cmd_code: 0x00001003 GD_JPEG_ENCODING_SETUP
  1512. U32 cmd_code;
  1513. U32 chroma_format;
  1514. U32 bits_fifo_base;
  1515. U32 bits_fifo_limit;
  1516. U32 info_fifo_base;
  1517. U32 info_fifo_limit;
  1518. U32 *quant_matrix_addr;
  1519. U32 custom_encoder_frame_rate;
  1520. U32 mctf_mode : 8;
  1521. U32 is_mjpeg : 1;
  1522. U32 frame_rate_division_factor : 8;
  1523. U32 session_id : 4;
  1524. U32 frame_rate_multiplication_factor: 8;
  1525. U32 hflip : 1;
  1526. U32 vflip : 1;
  1527. U32 rotate : 1;
  1528. U32 targ_bits_pp;
  1529. U32 initial_ql : 8;
  1530. U32 tolerance : 8;
  1531. U32 max_recode_lp : 8;
  1532. U32 total_sample_pts : 8;
  1533. U32 rate_curve_dram_addr;
  1534. U16 screen_thumbnail_w;
  1535. U16 screen_thumbnail_h;
  1536. U16 screen_thumbnail_active_w;
  1537. U16 screen_thumbnail_active_h;
  1538. } GD_DSP_CMD_JPEG_ENCODE_SETUP_S;
  1539. typedef struct
  1540. {
  1541. // cmd_code: 0x00001004 GD_H264_DECODING_SETUP
  1542. U32 cmd_code;
  1543. U32 bits_fifo_base;
  1544. U32 bits_fifo_limit;
  1545. U32 fade_in_pic_addr;
  1546. U32 fade_in_pic_pitch;
  1547. U32 fade_in_alpha_start;
  1548. U32 fade_in_alpha_step;
  1549. U32 fade_in_total_frames;
  1550. U32 fade_out_pic_addr;
  1551. U32 fade_out_pic_pitch;
  1552. U32 fade_out_alpha_start;
  1553. U32 fade_out_alpha_step;
  1554. U32 fade_out_total_frames;
  1555. U8 cabac_to_recon_delay;
  1556. U8 forced_max_fb_size;
  1557. } GD_DSP_CMD_H264_DECODE_SETUP_S;
  1558. typedef struct
  1559. {
  1560. // cmd_code: 0x00001005 GD_JPEG_DECODING_SETUP
  1561. U32 cmd_code;
  1562. U32 bits_fifo_base;
  1563. U32 bits_fifo_limit;
  1564. U32 cross_fade_alpha_start;
  1565. U32 cross_fade_alpha_step;
  1566. U32 cross_fade_total_frames;
  1567. U8 background_y;
  1568. U8 background_cb;
  1569. U8 background_cr;
  1570. U8 reserved;
  1571. U16 max_vout_width;
  1572. U16 max_vout_height;
  1573. } GD_DSP_CMD_JPEG_DECODE_SETUP_S;
  1574. typedef struct
  1575. {
  1576. // cmd_code: 0x00001006 GD_RESET_OPERATION
  1577. U32 cmd_code;
  1578. } GD_DSP_CMD_RESET_OPERATION_S;
  1579. typedef struct
  1580. {
  1581. // cmd_code: 0x00001007 GD_VIDEO_OUTPUT_RESTART
  1582. U32 cmd_code;
  1583. U8 vout_id;
  1584. } GD_DSP_CMD_VIDEO_OUTPUT_RESTART_S;
  1585. typedef struct
  1586. {
  1587. // cmd_code: 0x00001008 GD_H264_ENC_USE_TIMER
  1588. U32 cmd_code;
  1589. U8 timer_scaler;
  1590. U8 display_opt;
  1591. U8 video_term_opt; // 0 terminate with frame wait, 1 reset idsp, and terminate right away
  1592. U8 reserved;
  1593. } GD_DSP_CMD_VIN_TIMER_MODE_S;
  1594. typedef struct
  1595. {
  1596. // cmd_code: 0x00001009 GD_CHIP_SELECTION
  1597. U32 cmd_code;
  1598. U8 chip_type;
  1599. } GD_DSP_CMD_CHIP_SELECT_S;
  1600. typedef struct
  1601. {
  1602. // cmd_code: 0x0000100A GD_HD_ECHO_SETUP
  1603. U32 cmd_code;
  1604. U8 enable;
  1605. } GD_DSP_CMD_HD_ECHO_SETUP_S;
  1606. typedef struct
  1607. {
  1608. U32 multiple_stream : 7; // 0:single stream, 1: multiple stream
  1609. U32 power_mode : 1; // 0:high power, 1: low power
  1610. } gd_application_mode_s;
  1611. typedef struct
  1612. {
  1613. // cmd_code: 0x0000100B GD_SYSTEM_SETUP_INFO
  1614. U32 cmd_code;
  1615. U32 preview_A_type : 8;
  1616. U32 preview_B_type : 8;
  1617. U32 voutA_osd_blend_enabled : 1 ; // if set, Mixing section of VOUTA is used for DRAM to DRAM OSD blending
  1618. U32 voutB_osd_blend_enabled : 1 ; // if set, Mixing section of VOUTB is used for DRAM to DRAM OSD blending
  1619. U32 coded_bits_interrupt_enabled: 1 ; // if set, VOUTA interrupt is generated to ARM for every H.264/MJPEG coded frame written to the bits FIFO
  1620. U32 pip_size_preview_enabled : 1 ; // if set, preview A/B/C may be downscaled to PiP resolution (ie: preveiw width < 320)
  1621. U32 low_delay_enabled : 1 ; // if set, IDSP will not insert one dummy frame latency after MCTF to compensate for OSD insertion. Only for M=1 case.
  1622. U32 padding : 11;
  1623. gd_application_mode_s sub_mode_sel; // 0: Camcorder mode (single-stream encoder) 1: DVR mode (multiple-stream encoder)
  1624. U8 num_yuv_src; // number of input YUV sources muxed together.
  1625. U8 resv_1;
  1626. U16 resv_2;
  1627. U32 audio_clk_freq;
  1628. U32 idsp_freq;
  1629. U16 sensor_HB_pixel;
  1630. U16 sensor_VB_pixel;
  1631. } GD_DSP_CMD_SYSTEM_SETUP_INFO_S;
  1632. typedef struct
  1633. {
  1634. // cmd_code: 0x0000100C GD_EIS_SWITCHVOUT_DURING_ENCODE
  1635. U32 cmd_code;
  1636. U8 enable;
  1637. } GD_DSP_CMD_EIS_SWITCHVOUT_DURING_ENCOD_S;
  1638. typedef struct
  1639. {
  1640. // cmd_code: 0x0000100D GD_DSP_DEBUG_LEVEL_SETUP
  1641. U32 cmd_code;
  1642. U8 module;
  1643. U8 debug_level;
  1644. U8 coding_thread_printf_disable_mask;
  1645. U8 padding;
  1646. } GD_DSP_CMD_DSP_DEBUG_LEVEL_SETUP_S;
  1647. typedef struct
  1648. {
  1649. // cmd_code: 0x0000100E GD_SYSTEM_PARAMETERS_SETUP
  1650. U32 cmd_code;
  1651. U32 audio_clk_freq;
  1652. U32 idsp_freq;
  1653. U16 sensor_HB_pixel;
  1654. U16 sensor_VB_pixel;
  1655. } GD_DSP_CMD_SYSTEM_PARAMETERS_SETUP_S;
  1656. typedef struct
  1657. {
  1658. // cmd_code: 0x0000100F GD_SYSTEM_IDSP_FREQ_SETUP
  1659. U32 cmd_code;
  1660. U32 idsp_freq;
  1661. } GD_DSP_CMD_SYSTEM_IDSP_FREQ_SETUP_S;
  1662. /*-------------------------------------------------
  1663. * 1. Sensor Input setup (0x00002001)
  1664. * 2. RGB gain adjustment (0x00002002)
  1665. * 3. Vignette compensation (0x00002003)
  1666. * 4. AAA statistics setup (0x00002004)
  1667. * 5. Luma Sharpen setup (0x00002005)
  1668. * 6. RGB to RGB setup (0x00002006) obsolete
  1669. * 7. RGB to YUV setup (0x00002007)
  1670. * 8. Gamma curve lookup table setup (0x00002008) obsolete
  1671. * 9. Noise filter setup (0x00002009)
  1672. * 10. Bad Pixel Correct setup (0x0000200A)
  1673. * 11. Vid Fade In Out setup (0x0000200B)
  1674. * 12. CFA Domain Leakage Filter setup (0x0000200C)
  1675. * 13. MCTF MV Stab setup (0x0000200D)
  1676. * 14. Set slow shutter upsampling rate (0x0000200E)
  1677. * 15. Sensor capture repeat (0x0000200F)
  1678. * 16. MCTF GMV setup (0x00002010)
  1679. -------------------------------------------------*/
  1680. typedef struct
  1681. {
  1682. // cmd_code: 0x00002001 GD_SENSOR_INPUT_SETUP
  1683. U32 cmd_code;
  1684. U8 sensor_id;
  1685. U8 field_format;
  1686. U8 sensor_resolution;
  1687. U8 sensor_pattern;
  1688. U8 first_line_field_0;
  1689. U8 first_line_field_1;
  1690. U8 first_line_field_2;
  1691. U8 first_line_field_3;
  1692. U8 first_line_field_4;
  1693. U8 first_line_field_5;
  1694. U8 first_line_field_6;
  1695. U8 first_line_field_7;
  1696. U32 sensor_readout_mode;
  1697. } GD_DSP_CMD_SENSOR_INPUT_SETUP_S;
  1698. typedef struct
  1699. {
  1700. // cmd_code: 0x00002002 GD_RGB_GAIN_ADJUSTMENT
  1701. U32 cmd_code;
  1702. U32 r_gain;
  1703. U32 g_even_gain;
  1704. U32 g_odd_gain;
  1705. U32 b_gain;
  1706. U32 group_index;
  1707. } GD_DSP_CMD_RGB_GAIN_ADJUST_S;
  1708. typedef struct
  1709. {
  1710. // cmd_code: 0x00002003 GD_VIGNETTE_COMPENSATION
  1711. U32 cmd_code;
  1712. U8 enable;
  1713. U8 gain_shift;
  1714. U16 group_index;
  1715. U32 tile_gain_addr;
  1716. U32 tile_gain_addr_green_even;
  1717. U32 tile_gain_addr_green_odd;
  1718. U32 tile_gain_addr_blue;
  1719. } GD_DSP_CMD_VIGNETTE_COMPENSATION_S;
  1720. typedef struct
  1721. {
  1722. // cmd_code: 0x00002004 GD_AAA_STATISTICS_SETUP
  1723. U32 cmd_code;
  1724. U32 on : 8;
  1725. U32 auto_shift : 8;
  1726. U32 reserved :16;
  1727. U32 data_fifo_base;
  1728. U32 data_fifo_limit;
  1729. U32 data_fifo2_base;
  1730. U32 data_fifo2_limit;
  1731. U16 awb_tile_num_col;
  1732. U16 awb_tile_num_row;
  1733. U16 awb_tile_col_start;
  1734. U16 awb_tile_row_start;
  1735. U16 awb_tile_width;
  1736. U16 awb_tile_height;
  1737. U16 awb_tile_active_width;
  1738. U16 awb_tile_active_height;
  1739. U16 awb_pix_min_value;
  1740. U16 awb_pix_max_value;
  1741. U16 ae_tile_num_col;
  1742. U16 ae_tile_num_row;
  1743. U16 ae_tile_col_start;
  1744. U16 ae_tile_row_start;
  1745. U16 ae_tile_width;
  1746. U16 ae_tile_height;
  1747. U16 af_tile_num_col;
  1748. U16 af_tile_num_row;
  1749. U16 af_tile_col_start;
  1750. U16 af_tile_row_start;
  1751. U16 af_tile_width;
  1752. U16 af_tile_height;
  1753. U16 af_tile_active_width;
  1754. U16 af_tile_active_height;
  1755. U16 ae_pix_min_value;
  1756. U16 ae_pix_max_value;
  1757. } GD_DSP_CMD_AAA_STATISTICS_SETUP_S;
  1758. typedef struct
  1759. {
  1760. // cmd_code: 0x00002005 GD_LUMA_SHARPEN_SETUP
  1761. U32 cmd_code;
  1762. U8 strength;
  1763. } GD_DSP_CMD_LUMA_SHARPEN_SETUP_S;
  1764. typedef struct
  1765. {
  1766. // cmd_code: 0x00002006 GD_RGB_TO_RGB_SETUP
  1767. U32 cmd_code;
  1768. S16 matrix_values[9];
  1769. } GD_DSP_CMD_RGB_TO_RGB_STUP_S;
  1770. typedef struct
  1771. {
  1772. // cmd_code: 0x00002007 GD_RGB_TO_YUV_SETUP
  1773. U32 cmd_code;
  1774. U16 matrix_values[9];
  1775. S16 y_offset;
  1776. S16 u_offset;
  1777. S16 v_offset;
  1778. U32 group_index;
  1779. } GD_DSP_CMD_RGB_TO_YUV_STUP_S;
  1780. typedef struct
  1781. {
  1782. // cmd_code: 0x00002008 GD_GAMMA_CURVE_LOOKUP
  1783. U32 cmd_code;
  1784. U32 tone_curve_addr; // for A2 : tone_curve_addr_red
  1785. U32 tone_curve_addr_green;
  1786. U32 tone_curve_addr_blue;
  1787. } GD_DSP_CMD_GAMMA_CURVE_SETUP_S;
  1788. typedef struct
  1789. {
  1790. // cmd_code: 0x00002009 GD_NOISE_FILTER_SETUP
  1791. U32 cmd_code;
  1792. U32 strength;
  1793. } GD_DSP_CMD_NOISE_FILTER_SETUP_S;
  1794. typedef struct
  1795. {
  1796. // cmd_code: 0x0000200A GD_BAD_PIXEL_CORRECT_SETUP
  1797. U32 cmd_code;
  1798. U32 dynamic_bad_pixel_enable;
  1799. U32 correction_mode;
  1800. U32 hot_pixel_addr;
  1801. U32 dark_pixel_addr;
  1802. U16 shift0_4;
  1803. U16 shift5;
  1804. U32 static_bad_pixel_map_addr;
  1805. } GD_DSP_CMD_BAD_PIXEL_CORRECT_SETUP_S;
  1806. typedef struct
  1807. {
  1808. // cmd_code: 0x0000200B GD_VID_FADE_IN_OUT_SETUP
  1809. U32 cmd_code;
  1810. U16 fade_in_duration;
  1811. U16 fade_out_duration;
  1812. U8 fade_white;
  1813. } GD_DSP_CMD_VID_FADE_IN_OUT_SETUP_S;
  1814. typedef struct
  1815. {
  1816. // cmd_code: 0x0000200C GD_CFA_DOMAIN_LEAKAGE_FILTER
  1817. U32 cmd_code;
  1818. U32 enable;
  1819. U8 alpha_rr;
  1820. U8 alpha_rb;
  1821. U8 alpha_br;
  1822. U8 alpha_bb;
  1823. U16 saturation_level;
  1824. } GD_DSP_CMD_CFA_DOMAIN_LEAKAGE_FILTER_S;
  1825. typedef struct
  1826. {
  1827. // cmd_code: 0x0000200D GD_MCTF_MV_STAB_SETUP
  1828. U32 cmd_code;
  1829. U8 noise_filter_strength;
  1830. U8 image_stabilize_strength;
  1831. U8 still_noise_filter_strength;
  1832. U8 reserved;
  1833. U32 mctf_cfg_dram_addr;
  1834. } GD_DSP_CMD_MCTF_MV_STAB_SETUP_S;
  1835. typedef struct
  1836. {
  1837. // cmd_code: 0x0000200E GD_SET_SLOW_SHUT_UP_SAMPL_RT
  1838. U32 cmd_code;
  1839. U8 slow_shutter_upsampling_rate;
  1840. } GD_DSP_CMD_SET_SLOW_SHUTTER_UPSAMPLING_RATE_S;
  1841. typedef struct
  1842. {
  1843. // cmd_code: 0x0000200F GD_SET_REPEAT_FRM
  1844. U32 cmd_code;
  1845. U32 repeat_cnt;
  1846. U32 mode_sel;
  1847. } GD_DSP_CMD_SENSOR_CAP_REPEAT_S;
  1848. typedef struct
  1849. {
  1850. // cmd_code: 0x00002010 GD_MCTF_GMV_SETUP
  1851. U32 cmd_code;
  1852. U32 enable_external_gmv;
  1853. U32 external_gmv;
  1854. } GD_DSP_CMD_MCTF_GMV_SETUP_S;
  1855. typedef struct
  1856. {
  1857. // cmd_code: 0x00002011 GD_DIS_SETUP
  1858. U32 cmd_code;
  1859. U8 x_pan_thd;
  1860. U8 y_pan_thd;
  1861. U8 x_dis_strength : 7;
  1862. U8 flg_mc_enabled : 1;
  1863. U8 y_dis_strength : 7;
  1864. U8 flg_rsc_enabled : 1;
  1865. U8 x_rsc_strength : 7;
  1866. U8 flg_dis_enabled : 1;
  1867. U8 y_rsc_strength : 7;
  1868. U8 blk_select : 1;
  1869. U16 focal_length;
  1870. U16 sensor_cell_width : 12;
  1871. U16 x_win_pullback_speed_if_pan : 4;
  1872. U16 sensor_cell_height : 12;
  1873. U16 y_win_pullback_speed_if_pan : 4;
  1874. U32* dis_hist_dram_addr;
  1875. U32 dis_hist_dram_size;
  1876. U16 me_y_top_blk_start_pos : 12;
  1877. S16 me_x_res : 4;
  1878. U16 me_y_bot_blk_start_pos : 12;
  1879. S16 me_y_res : 4;
  1880. U16 me_y_top_blk_height : 12;
  1881. U16 me_x_bin : 4;
  1882. U16 me_y_bot_blk_height : 12;
  1883. U16 me_y_bin : 4;
  1884. U32 me_lamda : 8;
  1885. U32 sensor_row_time : 17;
  1886. U32 mc_beta : 7;
  1887. S32 x_mov : 16;
  1888. S32 y_mov : 16;
  1889. S32 x_skew : 16;
  1890. S32 y_skew : 16;
  1891. } GD_DSP_CMD_DIS_ALGO_PARAMS_S;
  1892. /*-------------------------------------------------
  1893. * 0. Set vin capture windows (0x00002100)
  1894. * 1. Amplifier linearization (0x00002101)
  1895. * 2. Pixel Shuffle (0x00002102)
  1896. * 3. Black level correction (0x00002103)
  1897. * 4. Black level state tables (0x00002104)
  1898. * 5. Black level detection window (0x00002105)
  1899. * 6. Fixed pattern noise correction (0x00002106)
  1900. * 7. CFA noise filter (0x00002107)
  1901. * 8. Digital gain saturation level (0x00002108)
  1902. * 9. Local exposure (0x00002109)
  1903. * 10. Demoasic Filter (0x0000210A)
  1904. * 11. RGB noise filter (0x0000210B)
  1905. * 12. Color correction (0x0000210C)
  1906. * 13. Chroma media filter (0x0000210D)
  1907. * 14. Chroma scale (0x0000210E)
  1908. * 15. Luma sharpening (0x0000210F)
  1909. * 16. AAA statistics setup 1 (0x00002110)
  1910. * 17. AAA statistics setup 2 (0x00002111)
  1911. * 18. AAA pseudo Y setup (0x00002112)
  1912. * 19. AAA histogram setup (0x00002113)
  1913. * 20. Raw compression (0x00002114)
  1914. * 21. Raw decompression (0x00002115)
  1915. * 22. Rolling shutter compensation (0x00002116)
  1916. * 23. Set zoom factor (0x00002117)
  1917. * 24. AAA_STATISTICS_SETUP3 (0x00002118)
  1918. * 25. Set video preview (0x00002119)
  1919. * 26. Vin Reset (0x0000211A)
  1920. * 27. Anti-Aliasing (0x0000211B)
  1921. * 28. FPN Calibration (0x0000211C)
  1922. * 29. Black level global offset (0x0000211D)
  1923. -------------------------------------------------*/
  1924. typedef union
  1925. {
  1926. struct
  1927. {
  1928. U16 sw_reset : 1;
  1929. U16 enb_vin : 1;
  1930. U16 win_en : 1;
  1931. U16 data_edge : 1;
  1932. U16 mastSlav_mod : 2;
  1933. U16 emb_sync : 1;
  1934. U16 emb_sync_mode: 1;
  1935. U16 emb_sync_loc : 2;
  1936. U16 vs_pol : 1;
  1937. U16 hs_pol : 1;
  1938. U16 field_pol : 1;
  1939. U16 sony_fld_mod : 1;
  1940. U16 ec_enb : 1;
  1941. U16 reserved : 1;
  1942. } s_cntl_bit_fld;
  1943. U16 s_control;
  1944. } GD_S_CTRL_REG;
  1945. typedef union
  1946. {
  1947. struct
  1948. {
  1949. U16 pad_type :1;
  1950. U16 data_rate :1;
  1951. U16 :1;
  1952. U16 inp_src :1;
  1953. U16 inp_src_ty :1;
  1954. U16 src_pix_data_width:2;
  1955. U16 yuv_inp_ord :2;
  1956. U16 reserved :4;
  1957. U16 non_mipi_input:1; // New elemented added for a5s here
  1958. U16 reserved2 :2;
  1959. } s_inputCfg_bit_fld;
  1960. U16 s_inputCfg;
  1961. } GD_S_INPUT_CONFIG_REG;
  1962. typedef struct
  1963. {
  1964. U16 s_ctrl_reg;
  1965. U16 s_inpcfg_reg;
  1966. U16 s_status_reg;
  1967. U16 s_v_width_reg;
  1968. U16 s_h_width_reg;
  1969. U16 s_h_offset_top_reg;
  1970. U16 s_h_offset_bot_reg;
  1971. U16 s_v_reg;
  1972. U16 s_h_reg;
  1973. U16 s_min_v_reg;
  1974. U16 s_min_h_reg;
  1975. U16 s_trigger_0_start_reg;
  1976. U16 s_trigger_0_end_reg;
  1977. U16 s_trigger_1_start_reg;
  1978. U16 s_trigger_1_end_reg;
  1979. U16 s_vout_start_0_reg;
  1980. U16 s_vout_start_1_reg;
  1981. U16 s_cap_start_v_reg;
  1982. U16 s_cap_start_h_reg;
  1983. U16 s_cap_end_v_reg;
  1984. U16 s_cap_end_h_reg;
  1985. U16 s_blank_leng_h_reg;
  1986. U32 vsync_timeout;
  1987. U32 hsync_timeout;
  1988. } GD_DSP_CMD_VIN_CAP_REG_S;
  1989. typedef struct
  1990. {
  1991. // cmd_code: 0x00002100 GD_SET_VIN_CAPTURE_WIN
  1992. U32 cmd_code;
  1993. // reg 0x00: 0x04
  1994. U32 S_Control_reset : 1; // 0: no op 1: reset video in
  1995. U32 S_Control_enable : 1; // 0: idle 1: enable video in
  1996. U32 S_Control_win_en : 1; // enable capture window. automatic reset at the end of each capture
  1997. U32 S_Control_data_edge : 1; // Data clock edge. 0: valid on rising edge of sensor clock
  1998. // 1: valid on falling edge of sensor clock
  1999. U32 S_Control_mastSlav_mod : 2; // Bit [5:4] forms the following combination:
  2000. // 2b00: undefined
  2001. // 2b01: slave mode
  2002. // 2b10: master mode
  2003. // 2b11: undefined
  2004. U32 S_Control_data_emb_sync : 1; // sync code embedded in data. When set in master mode,
  2005. // this indicates sensors have embedded sync code while
  2006. // receiving seperate sync signals (Sony specific).
  2007. U32 S_Control_data_emb_sync_mode : 1; // Embedded sync mode. 0: ITU-656 style(8-bit) 1: ITU-656 style(full data range)
  2008. U32 S_Control_data_emb_sync_loc : 2; // Embedded sync code location (2-pixel wide input only).
  2009. // 2b00: embedded sync code carried on the lower pixel
  2010. // 2b01: embedded sync code carried on the upper pixel
  2011. // 2b1x: embedded sync code carried on both pixels [should programed to 2b1x for serial sensor interface modes]
  2012. U32 S_Control_data_vs_pol : 1; // vsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start)
  2013. U32 S_Control_data_hs_pol : 1; // hsync polarity. 0: active high (rising edge signals start) 1: active low (falling edge signals start)
  2014. U32 S_Control_data_field0_pol : 1; // 0: field 0 has ID set to 0 with wen assertion 1:field 0 has ID set to 1 with wen assertion
  2015. U32 S_Control_data_sony_field_mode : 1; // 0: normal field mode 1: Sony-specific field mode. The first field of a multi-field readout in Sony CCD/TG is indicated by the state of EXP/ID pin at the first assertion of WEN/FLD
  2016. U32 S_Control_data_ecc_enable : 1; // 656 error correction enable {including the sync code words in serial sensor mode]
  2017. U32 S_Control_data_hsync_mask : 1; // 0: Toggle hsync during vertical blanking 1: No hsync toggle during vertical blanking
  2018. // reg 0x01: 0x06
  2019. // input mode[4:0]
  2020. U32 S_InputConfig_pad_type : 1; // 0: LVCMOS 1: LVDS
  2021. U32 S_InputConfig_data_rate : 1; // 0: SDR 1: DDR
  2022. U32 S_InputConfig_data_width : 1; // 0: 1-pixel wide 1: 2-pixel wide [should be programed to 1 (2-pixel wide) for serial sensor interface modes]
  2023. U32 S_InputConfig_input_source : 1; // 0: from LVDS (lvds_idsp_sdata) 1: from GPIO (iopad_idsp_sdata). Input source and pad type forms three combinations:-LVDS source, LVDS pad.-LVDS source, LVCMOS pad.-GPIO source. (Pad type makes no difference.)
  2024. U32 S_InputConfig_RGB_YUV : 1; // 0: RGB input 1: YUV input
  2025. // The following are legal combinations for input mode (x: 0 or 1, -: no effect):
  2026. // x000x:SDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[13:0]
  2027. // x001x:DDR,1-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0]
  2028. // x0100:SDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[27:0]
  2029. // x0110:DDR,2-pixel wide RGB/YUV data, from lvds_idsp_sdata[55:0]
  2030. // 110--:1-pixel wide YUV data, from iopad_idsp_sdata[7:0]
  2031. // 111--:2-pixel wide YUV data, from iopad_idsp_sdata[15:0]
  2032. U32 S_InputConfig_Source_pixel_data_width : 2; // Source pixel data width. VIN aligns all pixel values to MSB at output.
  2033. // For example, 8-bit source means left shift by 6, 14-bit source means no shift,
  2034. // etc. YUV data coming from GPIO must be 8-bit wide. (Hardware ignores the configuration.)
  2035. // 2b00: 8-bit 2b01: 10-bit 2b10: 12-bit 2b11: 14-bit
  2036. U32 S_InputConfig_YUV_input_order : 2; // YUV input order
  2037. // For 1-pixel wide YUV data
  2038. // 00:Cr,Y0,Cb,Y1,
  2039. // 01:Cb,Y0,Cr,Y1,
  2040. // 10:Y0,Cr,Y1,Cb,
  2041. // 11:Y0,Cb,Y1,Cr,
  2042. // For 2-pixel wide YUV data
  2043. // 00:{Cr,Y},{Cb,Y},
  2044. // 01:{Cb,Y},{Cr,Y},
  2045. // 10:{Y,Cr},{Y,Cb},
  2046. // 11: {Y, Cb}, {Y, Cr},
  2047. U32 S_InputConfig_Number_of_active_SLVS_lanes : 2; // Number of active SLVS lanes
  2048. // 2b00: 4 lanes; 2b01: 8 lanes; 2b10: 12 lanes; 2b11: 16 lanes)
  2049. U32 S_InputConfig_Serial_sensor_interface_mode : 1; // Serial sensor interface mode (Micron and Sony)
  2050. U32 S_InputConfig_Sony_serial_sensor_interface_mode : 1; // Sony serial sensor interface mode
  2051. U32 S_InputConfig_VIN_clock_select : 1; // VIN clock select - use sensor or bit clock instead of IDSP clock
  2052. U32 : 2; // reserved
  2053. // reg 0x02: 0x08
  2054. // Status register: Write logic 1 to the status register clears the corresponding bit.
  2055. U32 S_Status_vsync : 1; // begin of frame detected
  2056. U32 S_Status_trig0 : 1; // trigger 0 status. 0: no trigger/ 1: triggered
  2057. U32 S_Status_trig1 : 1; // trigger 1 status. 0: no trigger/ 1: triggered
  2058. U32 S_Status_ovfl : 1; // synchronous FIFO overflow. 0: no overflow/ 1: overflow occurred
  2059. U32 S_Status_shortl : 1; // early hsync detected
  2060. U32 S_Status_shortf : 1; // early vsync detected
  2061. U32 S_Status_field : 3; // current video field (read only).
  2062. U32 S_Status_no_hsync : 1; // no hsync detected (time out)
  2063. U32 S_Status_no_vsync : 1; // no vsync detected (time out)
  2064. U32 S_Status_idsp_ahb_vsync : 1; // frame end signal to ARM
  2065. U32 S_Status_idsp_ahb_mst_vsync : 1; // master mode frame end signal to ARM
  2066. U32 S_Status_idsp_ahb_last_pxl : 1; // capture window end signal to ARM
  2067. U32 S_Status_ecc_uncorrectable : 1; // uncorrectable 656 errors
  2068. U32 S_Status_program_error : 1; // illegal programming detected. Currently the reported error includes:Master mode, active region exceeds frame region
  2069. // reg 0x03: 0x0A
  2070. // Vertical active region width (master mode only)
  2071. U32 S_Vwidth : 14; // vsync pulse width in unit of lines
  2072. U32 : 2; // reserved
  2073. // reg 0x04: 0x0C
  2074. // Horizontal active region width (master mode only).
  2075. U32 S_Hwidth : 14; // hsync pulse width in unit of pixels
  2076. U32 : 2; // reserved
  2077. // reg 0x05: 0x0E
  2078. U32 S_Hoffset_top : 14; //
  2079. U32 : 2; // reserved
  2080. // reg 0x06: 0x10
  2081. U32 S_Hoffset_bot : 14; //
  2082. U32 : 2; // reserved
  2083. // reg 0x07: 0x12
  2084. // Frame size, vertical (master mode only)
  2085. U32 S_V : 14; // Number of lines per field
  2086. U32 : 2; // reserved
  2087. // reg 0x08: 0x14
  2088. // Frame size, horizontal (in master mode only)
  2089. U32 S_H : 14; // Number of pixels per line
  2090. U32 : 2; // reserved
  2091. // reg 0x09: 0x16
  2092. // Minimum frame size, vertical (slave mode only)
  2093. U32 S_MinV : 14; // number of lines per field
  2094. U32 : 2; // reserved
  2095. // reg 0x0A: 0x18
  2096. // Minimum frame size, horizontal (slave mode only)
  2097. U32 S_MinH : 14; // number of pixels per line
  2098. U32 : 2; // reserved
  2099. // reg 0x0B: 0x1A
  2100. // Trigger 0 control
  2101. U32 S_Trigger0Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame,
  2102. // where n = startline (counting from 1st line active region)
  2103. U32 S_Trigger0Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger
  2104. U32 S_Trigger0Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled
  2105. // reg 0x0C: 0x1C
  2106. // Trigger 0 control
  2107. U32 S_Trigger0End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame,
  2108. // where n = lastline (counting from 1st line active region)
  2109. U32 : 2; // reserved
  2110. // reg 0x0D: 0x1E
  2111. // Trigger 1 control
  2112. U32 S_Trigger1Start_startline : 14; // startline. Assert trigger at the assertion of hsync of the n-thline of the frame,
  2113. // where n = startline (counting from 1st line active region)
  2114. U32 S_Trigger1Start_pol : 1; // polarity. 0: active low trigger/ 1: active high trigger
  2115. U32 S_Trigger1Start_enable : 1; // 0: trigger disabled/ 1: trigger enabled
  2116. // reg 0x0E: 0x20
  2117. // Trigger 1 control
  2118. U32 S_Trigger1End_startline : 14; // lastline. Deassert trigger at the assertion of hsync of the n-thline of the frame,
  2119. // where n = lastline (counting from 1st line active region)
  2120. U32 : 2; // reserved
  2121. // reg 0x0F: 0x22
  2122. // VOUT synchronization control
  2123. U32 S_VoutStart0_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line,
  2124. // where n = startline (counting from 1st line active region)
  2125. U32 : 1; // reserved
  2126. U32 S_VoutStart0_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field
  2127. // reg 0x10: 0x24
  2128. // VOUT synchronization control
  2129. U32 S_VoutStart1_startline : 14; // startline. Synchronization signal is asserted for the duration of the n-th line,
  2130. // where n = startline (counting from 1st line active region)
  2131. U32 : 1; // reserved
  2132. U32 S_VoutStart1_disable_field_check : 1; // 0: synchronization signal is set on even field/ 1: synchronization signal is set on each field
  2133. // reg 0x11: 0x26
  2134. // Capture window control, vertical start
  2135. U32 S_CapStartV : 14; // Start vertical location of capture window
  2136. U32 : 2; // reserved
  2137. // reg 0x12: 0x28
  2138. // Capture window control, horizontal start
  2139. U32 S_CapStartH : 14; // Start horizontal location of capture window
  2140. // In 8 channel , Sony serial sensor mode, the capture window should start 4
  2141. // pixels after the SAV (i.e. exclude the 4 pixels added by the receiver at the
  2142. // beginning of every line which are not part of the original active line)
  2143. U32 : 2; // reserved
  2144. // reg 0x13: 0x2A
  2145. // Capture window control, vertical end
  2146. U32 S_CapEndV : 14; // End vertical location of capture window
  2147. U32 : 2; // reserved
  2148. // reg 0x14: 0x2C
  2149. // Capture window control, horizontal end
  2150. U32 S_CapEndH : 14; // End horizontal location of capture window
  2151. // In 8 channel, Sony serial sensor mode, the capture window should end 4 pixels
  2152. // before the EAV sync code to exclude the additional sync code pixels.
  2153. U32 : 2; // reserved
  2154. // reg 0x15: 0x2E
  2155. // All-zero embedded sync horizontal blank interval length
  2156. U32 S_BlankLengthH : 14; // Blank interval length in sensor clock cycles
  2157. U32 : 2; // reserved
  2158. // reg 0x16: 0x30
  2159. // Vsync timeout limit (lower 16 bits) and also EAV column for SLVS mode.
  2160. U32 S_TimeoutVLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels
  2161. // reg 0x17: 0x32
  2162. // Vsync timeout limit (upper 16 bits)
  2163. U32 S_TimeoutVHigh : 16; //
  2164. // reg 0x18: 0x34
  2165. // Hsync timeout limit (lower 16 bits) and also Horizontal line length (SAV-to-SAV distance) in SLVS mode.
  2166. U32 S_TimeoutHLow : 16; // SLVS mode programing notes:Should be integer multiple of 4 and does not count SAV/EAV sync code pixels
  2167. // reg 0x19: 0x36
  2168. // Hsync timeout limit (lower 16 bits)
  2169. U32 S_TimeoutHHigh : 16; //
  2170. // reg 0x19: 0x38
  2171. U32 S_mipi_cfg1 : 16; //
  2172. // reg 0x1A: 0x3A
  2173. U32 S_mipi_cfg2 : 16; //
  2174. // reg 0x1B: 0x3C
  2175. U32 S_mipi_bdphyctl : 16; //
  2176. // reg 0x1C: 0x3E
  2177. U32 S_mipi_sdphyctl : 16; //
  2178. } GD_DSP_CMD_VIN_CAP_WIN_S;
  2179. typedef struct
  2180. {
  2181. // cmd_code: 0x00002101 GD_AMPLIFIER_LINEARIZATION
  2182. U32 cmd_code;
  2183. U32 enable;
  2184. U32 look_up_table_addr;
  2185. U32 exponent_table_addr;
  2186. U32 black_level_offset_table_addr;
  2187. } GD_DSP_CMD_AMPLIFIER_LINEAR_S;
  2188. typedef struct
  2189. {
  2190. // cmd_code: 0x00002102 GD_PIXEL_SHUFFLE
  2191. U32 cmd_code;
  2192. U32 enable;
  2193. U32 reorder_mode;
  2194. U32 input_width;
  2195. U16 start_index[8];
  2196. U16 pitch[8];
  2197. } GD_DSP_CMD_PIXEL_SHUFFLE_S;
  2198. typedef struct
  2199. {
  2200. // cmd_code: 0x00002103 GD_BLACK_LEVEL_CORRECTION_CONFIG
  2201. U32 cmd_code;
  2202. U32 column_enable;
  2203. U32 row_enable;
  2204. U32 black_level_mode;
  2205. U32 bad_pixel_mode_column;
  2206. U32 bad_pixel_mode_row;
  2207. U32 cold_pixel_thresh;
  2208. U32 hot_pixel_thresh;
  2209. U32 center_offset;
  2210. U32 column_replace;
  2211. U32 column_invalid_replace;
  2212. U32 column_invalid_thresh;
  2213. U32 row_invalid_thresh;
  2214. U32 column_average_k_frames;
  2215. U32 row_average_k_frames;
  2216. U32 column_black_gain;
  2217. U32 row_black_gain;
  2218. U32 column_bad_pixel_subtract;
  2219. U32 global_offset_ee;
  2220. U32 global_offset_eo;
  2221. U32 global_offset_oe;
  2222. U32 global_offset_oo;
  2223. } GD_DSP_CMD_BLACK_LEVEL_CORRECTTION_S;
  2224. typedef struct
  2225. {
  2226. // cmd_code: 0x00002104 GD_BLACK_LEVEL_STATE_TABLES
  2227. U32 cmd_code;
  2228. U32 num_columns;
  2229. U32 column_frame_acc_addr;
  2230. U32 column_average_acc_addr;
  2231. U32 num_rows;
  2232. U32 row_fixed_offset_addr;
  2233. U32 row_average_acc_addr;
  2234. } GD_DSP_CMD_BLACK_LEVEL_STATE_TABLE_S;
  2235. typedef struct
  2236. {
  2237. // cmd_code: 0x00002105 GD_BLACK_LEVEL_DETECTION_WINDOW
  2238. U32 cmd_code;
  2239. U8 top_black_present;
  2240. U8 bottom_black_present;
  2241. U8 left_black_present;
  2242. U8 right_black_present;
  2243. U32 top_black_start;
  2244. U32 top_black_end;
  2245. U32 bottom_black_start;
  2246. U32 bottom_black_end;
  2247. U32 left_black_start;
  2248. U32 left_black_end;
  2249. U32 right_black_start;
  2250. U32 right_black_end;
  2251. } GD_DSP_CMD_BLACK_LEVEL_DETECT_WIN_S;
  2252. typedef struct
  2253. {
  2254. // cmd_code: 0x00002106 GD_FIXED_PATTERN_NOISE_CORRECTION
  2255. U32 cmd_code;
  2256. U32 fpn_pixel_mode;
  2257. U32 row_gain_enable;
  2258. U32 column_gain_enable;
  2259. U32 num_of_rows;
  2260. U16 num_of_cols;
  2261. U16 fpn_pitch;
  2262. U32 fpn_pixels_addr;
  2263. U32 fpn_pixels_buf_size;
  2264. U32 intercept_shift;
  2265. U32 intercepts_and_slopes_addr;
  2266. U32 row_gain_addr;
  2267. U32 column_gain_addr;
  2268. } GD_DSP_CMD_FIXED_PATTERN_NOISE_CORRECT_S;
  2269. typedef struct
  2270. {
  2271. // cmd_code: 0x00002107 GD_CFA_NOISE_FILTER_INFO
  2272. U32 cmd_code;
  2273. U32 enable;
  2274. U32 center_weight_red;
  2275. U32 center_weight_green;
  2276. U32 center_weight_blue;
  2277. U32 thresh_k0_red;
  2278. U32 thresh_k0_green;
  2279. U32 thresh_k0_blue;
  2280. U32 thresh_k0_close;
  2281. U32 thresh_k1_red;
  2282. U32 thresh_k1_green;
  2283. U32 thresh_k1_blue;
  2284. U32 direct_center_weight_red;
  2285. U32 direct_center_weight_green;
  2286. U32 direct_center_weight_blue;
  2287. U32 direct_thresh_k0_red;
  2288. U32 direct_thresh_k0_green;
  2289. U32 direct_thresh_k0_blue;
  2290. U32 direct_thresh_k1_red;
  2291. U32 direct_thresh_k1_green;
  2292. U32 direct_thresh_k1_blue;
  2293. U32 direct_grad_thresh;
  2294. } GD_DSP_CMD_CFA_NOISE_FILTER_INFO_S;
  2295. typedef struct
  2296. {
  2297. // cmd_code: 0x00002108 GD_DIGITAL_GAIN_SATURATION_LEVEL
  2298. U32 cmd_code;
  2299. U32 level_red;
  2300. U32 level_green_even;
  2301. U32 level_green_odd;
  2302. U32 level_blue;
  2303. U32 group_index;
  2304. } GD_DSP_CMD_DIGITAL_GAIN_LEVEL_S;
  2305. typedef struct
  2306. {
  2307. // cmd_code: 0x00002109 GD_LOCAL_EXPOSURE
  2308. U32 cmd_code;
  2309. U16 enable;
  2310. U16 group_index;
  2311. U32 radius;
  2312. U8 luma_weight_red;
  2313. U8 luma_weight_green;
  2314. U8 luma_weight_blue;
  2315. U8 luma_weight_sum_shift;
  2316. U32 gain_curve_table_addr;
  2317. U16 black_level_offset_red;
  2318. U16 black_level_offset_green;
  2319. U16 black_level_offset_blue;
  2320. U16 luma_offset;
  2321. U16 global_offset;
  2322. } GD_DSP_CMD_LOCAL_EXPOSURE_S;
  2323. typedef struct
  2324. {
  2325. // cmd_code: 0x0000210A GD_DEMOASIC_FILTER
  2326. U32 cmd_code;
  2327. U16 enable;
  2328. U16 group_index;
  2329. U32 grad_clip_thresh;
  2330. U32 grad_noise_thresh;
  2331. U32 activity_thresh;
  2332. U32 activity_difference_thresh;
  2333. } GD_DSP_CMD_DEMOASIC_FILTER_S;
  2334. typedef struct
  2335. {
  2336. // cmd_code: 0x0000210B GD_RGB_NOISE_FILTER
  2337. U32 cmd_code;
  2338. U32 speckle_filter_enable;
  2339. U32 reinterpol_filter_enable;
  2340. U32 jag_filter_enable;
  2341. U32 jag_thresh_grad_add;
  2342. U32 jag_thresh_grad_mult;
  2343. U32 jag_thresh_add;
  2344. U16 jag_thresh_mult;
  2345. U16 group_index;
  2346. U8 direction_filter_enable;
  2347. U8 thresh_grad_mult;
  2348. U16 thresh_grad_add;
  2349. U8 streng_origin_red;
  2350. U8 streng_origin_green;
  2351. U8 streng_origin_blue;
  2352. U8 streng_interpol_red;
  2353. U8 streng_interpol_green;
  2354. U8 streng_interpol_blue;
  2355. U8 streng_isotrop_origin_red;
  2356. U8 streng_isotrop_origin_green;
  2357. U8 streng_isotrop_origin_blue;
  2358. U8 streng_isotrop_interpol_red;
  2359. U8 streng_isotrop_interpol_green;
  2360. U8 streng_isotrop_interpol_blue;
  2361. } GD_DSP_CMD_RGB_NOISE_FILTER_S;
  2362. typedef struct
  2363. {
  2364. // cmd_code: 0x0000210C GD_COLOR_CORRECTION
  2365. U32 cmd_code;
  2366. U8 enable;
  2367. U8 no_interpolation;
  2368. U8 yuv422_foramt;
  2369. U8 uv_center;
  2370. U32 multi_red;
  2371. U32 multi_green;
  2372. U32 multi_blue;
  2373. U32 in_lookup_table_addr;
  2374. U32 matrix_addr;
  2375. U32 output_lookup_bypass;
  2376. U32 out_lookup_table_addr;
  2377. U32 group_index;
  2378. } GD_DSP_CMD_COLOR_CORRECTION_S;
  2379. typedef struct
  2380. {
  2381. // cmd_code: 0x0000210D GD_CHROMA_MEDIAN_FILTER_INFO
  2382. U32 cmd_code;
  2383. U32 enable;
  2384. U32 group_index;
  2385. U32 k0123_table_addr;
  2386. U16 u_sat_t0;
  2387. U16 u_sat_t1;
  2388. U16 v_sat_t0;
  2389. U16 v_sat_t1;
  2390. U16 u_act_t0;
  2391. U16 u_act_t1;
  2392. U16 v_act_t0;
  2393. U16 v_act_t1;
  2394. } GD_DSP_CMD_CHROMA_MEDIAN_FILTER_INFO_S;
  2395. typedef struct
  2396. {
  2397. // cmd_code: 0x0000210E GD_CHROMA_SCALE
  2398. U32 cmd_code;
  2399. U32 enable;
  2400. U32 make_legal;
  2401. S16 u_weight_0;
  2402. S16 u_weight_1;
  2403. S16 u_weight_2;
  2404. S16 v_weight_0;
  2405. S16 v_weight_1;
  2406. S16 v_weight_2;
  2407. U32 gain_curver_addr;
  2408. U32 group_index;
  2409. } GD_DSP_CMD_CHROMA_SCALE_S;
  2410. typedef struct
  2411. {
  2412. // cmd_code: 0x0000210F GD_LUMA_SHARPENING
  2413. U32 cmd_code;
  2414. U32 enable;
  2415. U32 grad_thresh_0;
  2416. U32 grad_thresh_1;
  2417. U32 smooth_shift;
  2418. U32 edge_shift;
  2419. U32 edge_thresh;
  2420. U32 alpha_table_addr;
  2421. U32 group_index;
  2422. U32 unsharp_mask[6];
  2423. U8 clip_low;
  2424. U8 clip_high;
  2425. U8 max_change_down;
  2426. U8 max_change_up;
  2427. } GD_DSP_CMD_LUMA_SHARPENING_S;
  2428. typedef struct
  2429. {
  2430. // cmd_code: 0x00002110 GD_AAA_STATISTICS_SETUP1
  2431. // cmd_code: 0x00002111 GD_AAA_STATISTICS_SETUP2
  2432. U32 cmd_code;
  2433. U8 af_horizontal_filter_mode : 4;
  2434. U8 af_filter_select : 4;
  2435. U8 af_horizontal_filter_stage1_enb;
  2436. U8 af_horizontal_filter_stage2_enb;
  2437. U8 af_horizontal_filter_stage3_enb;
  2438. U16 af_horizontal_filter_gain[7];
  2439. U16 af_horizontal_filter_shift[4];
  2440. U16 af_horizontal_filter_bias_off;
  2441. U16 af_horizontal_filter_thresh;
  2442. U16 af_vertical_filter_thresh;
  2443. U16 af_tile_fv_horizontal_shift;
  2444. U16 af_tile_fv_vertical_shift;
  2445. U16 af_tile_fv_horizontal_weight;
  2446. U16 af_tile_fv_vertical_weight;
  2447. } GD_DSP_CMD_AAA_STATISTICS_SETUP12_S;
  2448. typedef struct
  2449. {
  2450. // cmd_code: 0x00002112 GD_AAA_PSEUDO_Y_SETUP
  2451. U32 cmd_code;
  2452. U32 mode;
  2453. U32 sum_shift;
  2454. U8 pixel_weight[4];
  2455. U8 tone_curve[32];
  2456. } GD_DSP_CMD_AAA_PSEUDO_Y_S;
  2457. typedef struct
  2458. {
  2459. // cmd_code: 0x00002113 GD_AAA_HISTORGRAM_SETUP
  2460. U32 cmd_code;
  2461. U16 mode;
  2462. U16 histogram_select;
  2463. U16 ae_file_mask[8];
  2464. } GD_DSP_CMD_AAA_HISTOGRAM_S;
  2465. typedef struct
  2466. {
  2467. // cmd_code: 0x00002114 GD_RAW_COMPRESSION
  2468. U32 cmd_code;
  2469. U32 enable;
  2470. U32 lossy_mode;
  2471. U32 vic_mode;
  2472. } GD_DSP_CMD_RAW_COMPRESSION_S;
  2473. typedef struct
  2474. {
  2475. // cmd_code: 0x00002115 GD_RAW_DECOMPRESSION
  2476. U32 cmd_code;
  2477. U32 enable;
  2478. U32 lossy_mode;
  2479. U32 vic_mode;
  2480. U32 image_width;
  2481. U32 image_height;
  2482. } GD_DSP_CMD_RAW_DECOMPRESSION_S;
  2483. typedef struct
  2484. {
  2485. // cmd_code: 0x00002116 GD_ROLLING_SHUTTER_COMPENSATION
  2486. U32 cmd_code;
  2487. U32 enable;
  2488. U32 skew_init_phase_horizontal;
  2489. U32 skew_phase_incre_horizontal;
  2490. U32 skew_phase_incre_vertical;
  2491. } GD_DSP_CMD_ROLLING_SHUTTER_COMPENSATION_S;
  2492. typedef struct
  2493. {
  2494. // cmd_code: 0x00002117 GD_SET_ZOOM_FACTOR
  2495. U32 cmd_code;
  2496. U32 zoom_x;
  2497. U32 zoom_y;
  2498. U32 x_center_offset;
  2499. U32 y_center_offset;
  2500. } GD_DSP_CMD_ZOOM_FACTOR_S;
  2501. typedef struct
  2502. {
  2503. // cmd_code: 0x00002118 GD_AAA_STATISTICS_SETUP3
  2504. U32 cmd_code;
  2505. U16 awb_tile_rgb_shift;
  2506. U16 awb_tile_y_shift;
  2507. U16 awb_tile_min_max_shift;
  2508. U16 ae_tile_y_shift;
  2509. U16 ae_tile_linear_y_shift;
  2510. U16 af_tile_cfa_y_shift;
  2511. U16 af_tile_y_shift;
  2512. } GD_DSP_CMD_AAA_STATISTICS_SETUP3_S;
  2513. typedef struct
  2514. {
  2515. // cmd_code: 0x00002119 GD_VIDEO_PREVIEW_SETUP
  2516. U32 cmd_code;
  2517. U8 preview_id;
  2518. U8 preview_format;
  2519. U16 preview_w;
  2520. U16 preview_h;
  2521. U8 preview_frame_rate;
  2522. U8 preview_en;
  2523. /*
  2524. ?* new fields for preview source window parameters of preview A and B
  2525. ?* x/y offset is relative to the upper left
  2526. ?* corner of the Main window.
  2527. ?*/
  2528. U16 preview_src_w;
  2529. U16 preview_src_h;
  2530. U16 preview_src_x_offset;
  2531. U16 preview_src_y_offset;
  2532. U32 preview_freeze_enabled : 1;
  2533. U32 preview_freeze_offset_x : 10;
  2534. U32 preview_freeze_offset_y : 10;
  2535. U32 resv : 11;
  2536. } GD_DSP_CMD_VIDEO_PREVIEW_S;
  2537. typedef struct
  2538. {
  2539. // cmd_code: 0x0000211B GD_ANTI_ALIASING
  2540. U32 cmd_code;
  2541. U32 enable;
  2542. U32 threshold;
  2543. U32 shift;
  2544. } GD_DSP_CMD_ANTI_ALIASING_FILTER_S;
  2545. typedef struct
  2546. {
  2547. // cmd_code: 0x0000211C GD_FPN_CALIBRATION
  2548. U32 cmd_code;
  2549. U32 dram_addr;
  2550. U32 width;
  2551. U32 height;
  2552. U32 num_of_frames;
  2553. } GD_DSP_CMD_FPN_CALIBRATION_S;
  2554. typedef struct
  2555. {
  2556. // cmd_code: 0x0000211D GD_BLACK_LEVEL_GLOBAL_OFFSET
  2557. U32 cmd_code;
  2558. U32 global_offset_ee;
  2559. U32 global_offset_eo;
  2560. U32 global_offset_oe;
  2561. U32 global_offset_oo;
  2562. U16 black_level_offset_red;
  2563. U16 black_level_offset_green;
  2564. U16 black_level_offset_blue;
  2565. } GD_DSP_CMD_BLACK_LEVEL_GLOBAL_OFFSET_S;
  2566. typedef struct
  2567. {
  2568. // cmd_code: 0x0000211E GD_RGB_DIRECTIONAL_FILTER
  2569. U32 cmd_code;
  2570. U8 directional_filter_enable;
  2571. U8 thresh_gradient_mult;
  2572. U16 thresh_gradient_add;
  2573. U16 thresh_blend_dir_0;
  2574. U16 thresh_blend_dir_1;
  2575. U16 thresh_blend_iso_0;
  2576. U16 thresh_blend_iso_1;
  2577. U32 coeff_dir_orig_addr;
  2578. U32 coeff_iso_orig_addr;
  2579. U32 coeff_dir_interpolated_addr;
  2580. U32 coeff_iso_interpolated_addr;
  2581. } GD_DSP_CMD_RGB_DIRECTIONAL_FILTER_S;
  2582. typedef struct
  2583. {
  2584. // cmd_code: 0x0000211F GD_HDR_MIXER
  2585. U32 cmd_code;
  2586. U32 mixer_mode;
  2587. U8 radius;
  2588. U8 luma_weight_red;
  2589. U8 luma_weight_green;
  2590. U8 luma_weight_blue;
  2591. U16 threshold;
  2592. U8 thresh_delta;
  2593. U8 long_exposure_shift;
  2594. } GD_DSP_CMD_HDR_MIXER_S;
  2595. typedef struct
  2596. {
  2597. // cmd_code: 0x00002120 GD_LUMA_SHARPENING_LINEARIZATION
  2598. U32 cmd_code;
  2599. U32 enable;
  2600. U32 linearization_table_addr;
  2601. U32 inverse_linearization_table_addr;
  2602. U32 low_noise_luma_linearization_table_addr;
  2603. U32 group_index;
  2604. } GD_DSP_CMD_LUMA_SHARPENING_LINEARIZATION_S;
  2605. typedef struct
  2606. {
  2607. // cmd_code: 0x00002121 GD_LUMA_SHARPENING_FIR_CONFIG
  2608. U32 cmd_code;
  2609. U8 enable_FIR1;
  2610. U8 enable_FIR2;
  2611. U16 enable_FIR2_bypass_alpha;
  2612. U32 fir0_clip_low;
  2613. U32 fir0_clip_high;
  2614. U32 fir1_clip_low;
  2615. U32 fir1_clip_high;
  2616. U32 fir2_clip_low;
  2617. U32 fir2_clip_high;
  2618. U32 coeff_FIR0_addr;
  2619. U32 coeff_FIR1_addr;
  2620. U32 coeff_FIR2_addr;
  2621. U32 coring_table_addr;
  2622. U32 group_index;
  2623. } GD_DSP_CMD_LUMA_SHARPENING_FIR_CONFIG_S;
  2624. typedef struct
  2625. {
  2626. // cmd_code: 0x00002122 GD_LUMA_SHARPENING_LNL
  2627. U32 cmd_code;
  2628. U8 enable;
  2629. U8 weight_red;
  2630. U8 weight_green;
  2631. U8 weight_blue;
  2632. U32 input_clip_red;
  2633. U32 input_clip_green;
  2634. U32 input_clip_blue;
  2635. U32 low_noise_luma_linearization_table_addr;
  2636. U32 tone_curve_addr;
  2637. U32 group_index;
  2638. } GD_DSP_CMD_LUMA_SHARPENING_LNL_S;
  2639. typedef struct
  2640. {
  2641. // cmd_code: 0x00002123 GD_LUMA_SHARPENING_TONE
  2642. U32 cmd_code;
  2643. U8 enable;
  2644. U8 enable_manual_luma_adjust;
  2645. U8 luma_low;
  2646. U8 luma_high;
  2647. U8 luma_alpha_low;
  2648. U8 luma_alpha_high;
  2649. U8 luma_delta_low;
  2650. U8 luma_delta_high;
  2651. U32 tone_control_config_addr;
  2652. U32 group_index;
  2653. } GD_DSP_CMD_LUMA_SHARPENING_TONE_CONTROL_S;
  2654. typedef struct
  2655. {
  2656. // cmd_code: 0x00002124 GD_MULTI_STREAM_VIDEO_PREVIEW
  2657. U32 cmd_code;
  2658. U16 preview_id;
  2659. U16 num_preview_ins;
  2660. U32 preview_src : 8;
  2661. U32 dis_dev_x_loc : 12;
  2662. U32 dis_dev_y_loc : 12;
  2663. U16 preview_width;
  2664. U16 preview_height;
  2665. } GD_DSP_CMD_MULTI_STREAM_PREVIEW_S;
  2666. typedef struct
  2667. {
  2668. // cmd_code: 0x00002125 GD_ENA_SECOND_STREAM_ENCODE
  2669. U32 cmd_code;
  2670. U32 primary_stream_channel : 24;
  2671. U32 frame_rate : 8;
  2672. U16 output_width;
  2673. U16 output_height;
  2674. U16 encode_width;
  2675. U16 encode_height;
  2676. } GD_DSP_CMD_ENA_SECOND_STREAM_S;
  2677. typedef struct
  2678. {
  2679. // cmd_code: 0x00002126 GD_SET_ALPHA_CHANNEL
  2680. U32 cmd_code;
  2681. U32 luma_alpha_addr;
  2682. U32 chroma_alpha_addr;
  2683. U16 luma_alpha_pitch;
  2684. U16 luma_alpha_width;
  2685. U16 luma_alpha_height;
  2686. U16 chroma_alpha_pitch;
  2687. U16 chroma_alpha_width;
  2688. U16 chroma_alpha_height;
  2689. } GD_DSP_CMD_SET_ALPHA_CHANNEL_S;
  2690. /**
  2691. *
  2692. * Modify Frame Buffer
  2693. * Used to get some DRAM from DSP in some mode
  2694. * and return it back to DSP when finished.
  2695. * User only send this command when the DSP is in IDEL State.
  2696. */
  2697. typedef struct
  2698. {
  2699. // cmd_code: 0x00002127 GD_MODIFY_FRAME_BUFFER
  2700. U32 cmd_code;
  2701. U32 dramStart; //32 bits DRAM ADDRSS of the Frame Buffer. Must be 32 bits aligned
  2702. U32 dramSize; //32 bits Size of the DRAM for DSP.
  2703. } GD_DSP_CMD_MODIFY_FRAME_BUFFER_S;
  2704. typedef struct
  2705. {
  2706. // cmd_code: 0x00002128 GD_SET_ACT_WIN_CENTER
  2707. U32 cmd_code;
  2708. S32 x_offset;
  2709. S32 y_offset;
  2710. S32 x_frm_mv;
  2711. S32 y_frm_mv;
  2712. } GD_DSP_CMD_SET_ATIVE_WIN_CTR_OFS_S;
  2713. typedef struct
  2714. {
  2715. // cmd_code: 0x00002129 GD_SET_WARP_CONTROL
  2716. U32 cmd_code;
  2717. U32 warp_control;
  2718. U32 warp_horizontal_table_address;
  2719. U32 warp_vertical_table_address;
  2720. U32 actual_left_top_x;
  2721. U32 actual_left_top_y;
  2722. U32 actual_right_bot_x;
  2723. U32 actual_right_bot_y;
  2724. U32 zoom_x;
  2725. U32 zoom_y;
  2726. U32 x_center_offset;
  2727. U32 y_center_offset;
  2728. U8 grid_array_width;
  2729. U8 grid_array_height;
  2730. U8 horz_grid_spacing_exponent;
  2731. U8 vert_grid_spacing_exponent;
  2732. U8 vert_warp_enable;
  2733. U8 vert_warp_grid_array_width;
  2734. U8 vert_warp_grid_array_height;
  2735. U8 vert_warp_horz_grid_spacing_exponent;
  2736. U8 vert_warp_vert_grid_spacing_exponent;
  2737. U8 binning;
  2738. U16 reserved_2;
  2739. S32 hor_skew_phase_inc;
  2740. /*
  2741. This one is used for ARM to calcuate the
  2742. dummy window for Ucode, these fields should be
  2743. zero for turbo command in case of EIS. could be
  2744. non-zero valid value only when this warp command is send
  2745. in non-turbo command way.
  2746. */
  2747. U16 dummy_window_x_left;
  2748. U16 dummy_window_y_top;
  2749. U16 dummy_window_width;
  2750. U16 dummy_window_height;
  2751. /*
  2752. This field is used for ARM to calculate the
  2753. cfa prescaler zoom factor which will affect
  2754. the warping table value. this should also be zeor
  2755. during the turbo command sending.Only valid on the
  2756. non-turbo command time.
  2757. */
  2758. U16 cfa_output_width;
  2759. U16 cfa_output_height;
  2760. } GD_DSP_CMD_SET_WARP_CONTROL_S;
  2761. typedef struct
  2762. {
  2763. // cmd_code: 0x0000212A GD_EARLY_WB_GAIN
  2764. U32 cmd_code;
  2765. U32 cfa_early_red_multiplier;
  2766. U32 cfa_early_green_multiplier_even;
  2767. U32 cfa_early_green_multiplier_odd;
  2768. U32 cfa_early_blue_multiplier;
  2769. U32 aaa_early_red_multiplier;
  2770. U32 aaa_early_green_multiplier_even;
  2771. U32 aaa_early_green_multiplier_odd;
  2772. U32 aaa_early_blue_multiplier;
  2773. } GD_DSP_CMD_EARLY_WB_GAIN_S;
  2774. typedef struct
  2775. {
  2776. // cmd_code: 0x00002130 GD_LUMA_SHARPENING_EDGE_CONTROL
  2777. U32 cmd_code;
  2778. U32 group_index;
  2779. U16 edge_threshold;
  2780. U8 edge_threshold_multiplier;
  2781. U8 wide_weight;
  2782. U8 narrow_weight;
  2783. } GD_DSP_CMD_LUMA_SHARPENING_EDGE_CONTROL_S;
  2784. typedef struct
  2785. {
  2786. // cmd_code: 0x00002131 GD_LUMA_SHARPENING_BLEND_CONTROL
  2787. U32 cmd_code;
  2788. U32 group_index;
  2789. U16 enable;
  2790. U8 edge_threshold_multiplier;
  2791. U8 iso_threshold_multiplier;
  2792. U16 edge_threshold0;
  2793. U16 edge_threshold1;
  2794. U16 dir_threshold0;
  2795. U16 dir_threshold1;
  2796. U16 iso_threshold0;
  2797. U16 iso_threshold1;
  2798. } GD_DSP_CMD_LUMA_SHARPENING_BLEND_CONTROL_S;
  2799. typedef struct
  2800. {
  2801. // cmd_code: 0x00002132 GD_LUMA_SHARPENING_LEVEL_CONTROL
  2802. U32 cmd_code;
  2803. U32 group_index;
  2804. U32 select;
  2805. U8 low;
  2806. U8 low_0;
  2807. U8 low_delta;
  2808. U8 low_val;
  2809. U8 high;
  2810. U8 high_0;
  2811. U8 high_delta;
  2812. U8 high_val;
  2813. U8 base_val;
  2814. U8 area;
  2815. U16 level_control_clip_low;
  2816. U16 level_control_clip_low2;
  2817. U16 level_control_clip_high;
  2818. U16 level_control_clip_high2;
  2819. } GD_DSP_CMD_LUMA_SHARPENING_LEVEL_CONTROL_S;
  2820. typedef struct
  2821. {
  2822. // cmd_code: 0x00002133 GD_LUMA_SHARPENING_MISC_CONTROL
  2823. U32 cmd_code;
  2824. U32 group_index;
  2825. U8 coring_control;
  2826. U8 add_in_low_pass;
  2827. U8 second_input_enable;
  2828. U8 second_input_signed;
  2829. U8 second_input_shift;
  2830. U8 output_signed;
  2831. U8 output_shift;
  2832. U8 abs;
  2833. U8 yuv;
  2834. } GD_DSP_CMD_LUMA_SHARPENING_MISC_CONTROL_S;
  2835. typedef struct
  2836. {
  2837. // cmd_code: 0x00002134 GD_AAA_EARLY_WB_GAIN
  2838. U32 cmd_code;
  2839. U32 red_multiplier;
  2840. U32 green_multiplier_even;
  2841. U32 green_multiplier_odd;
  2842. U32 blue_multiplier;
  2843. U8 enable_ae_wb_gain;
  2844. U8 enable_af_wb_gain;
  2845. U8 enable_histogram_wb_gain;
  2846. U8 reserved;
  2847. U32 red_wb_multiplier;
  2848. U32 green_wb_multiplier_even;
  2849. U32 green_wb_multiplier_odd;
  2850. U32 blue_wb_multiplier;
  2851. } GD_DSP_CMD_AAA_EARLY_WB_GAIN_S;
  2852. /*-------------------------------------------------
  2853. * H264/JPEG encoding mode
  2854. * 1. Video Preprocessing (0x00003001)
  2855. * 2. Fast AAA capture (0x00003002)
  2856. * 3. H264 encode (0x00003004)
  2857. * 4. H264 encode from memory (0x00003005) invalid
  2858. * 5. H264 bits FIFO update (0x00003006)
  2859. * 6. H264 encoding stop (0x00003007)
  2860. * 7. Still capture (0x00004001)
  2861. * 8. JPEG encode/rescale from memory (0x00004002)
  2862. * 9. JPEG bits FIFO update (0x00004003)
  2863. * 10. Free RAW/YUV422 pictures buffers (0x00004004)
  2864. * 11. JPEG/RQW/YUV/422 Stop (0x00004005)
  2865. * 12. Vid Fade In Out (0x00004007)
  2866. * 13. MJPEG encode with h264 (0x00004008)
  2867. * 14. OSD insert in MJPEG and H264 (0x00004009)
  2868. * 15. YUV422 capture (0x00004010)
  2869. * 16. Send cavlc result (0x00004011)
  2870. -------------------------------------------------*/
  2871. typedef struct
  2872. {
  2873. // cmd_code: 0x00003001 GD_VIDEO_PREPROCESSING
  2874. U32 cmd_code;
  2875. U32 input_format : 8;
  2876. U32 sensor_id : 8;
  2877. U32 keep_states : 8;
  2878. U32 vin_frame_rate : 8;
  2879. U16 vidcap_w;
  2880. U16 vidcap_h;
  2881. U16 main_w;
  2882. U16 main_h;
  2883. U16 encode_w;
  2884. U16 encode_h;
  2885. U16 encode_x;
  2886. U16 encode_y;
  2887. U16 preview_w_A;
  2888. U16 preview_h_A;
  2889. U32 input_center_x;
  2890. U32 input_center_y;
  2891. U32 zoom_factor_x;
  2892. U32 zoom_factor_y;
  2893. U32 aaa_data_fifo_start;
  2894. U32 sensor_readout_mode;
  2895. U8 noise_filter_strength;
  2896. U8 image_stabilize_strength;
  2897. U8 bit_resolution;
  2898. U8 bayer_pattern;
  2899. U8 preview_format_A : 4;
  2900. U8 preview_format_B : 3;
  2901. U8 no_pipelineflush : 1;
  2902. U8 preview_frame_rate_A;
  2903. U16 preview_w_B;
  2904. U16 preview_h_B;
  2905. U8 preview_frame_rate_B;
  2906. U8 preview_A_en : 4; // 0: dram, 1: smem
  2907. U8 preview_B_en : 4; // 0: dram, 1: smem
  2908. U16 horizontal_channel_number; // number of channels (streams) displayed on horizontal direction in preview window.
  2909. U16 vertical_channel_number; //number of channels (streams) displayed on vertical direction in preview window.
  2910. U8 vin_frame_rate_ext;
  2911. U8 vdsp_int_factor;
  2912. U8 main_out_frame_rate;
  2913. U8 main_out_frame_rate_ext;
  2914. U8 vid_skip; //used to skip N start frames in VIN capture to avoid bad frames
  2915. U8 EIS_enable : 1; //Used to inidcate that EIS will be used.
  2916. U8 DIS_enable : 1; //Used to indicate that DIS will be used
  2917. U8 Vert_WARP_enable : 1; //Used to indicate that Vertical WARP will be used
  2918. U8 no_vin_reset_exiting : 1; //Used to indicate that we do not need to resetting vin and need to wait
  2919. //out the vin before exiting VIDEO mode to TIMER mode
  2920. U8 support_cfa_out_win_2129 : 1; //Enable teh CFA output window support in ucode.
  2921. //This one is only useful for non DIS pipeline
  2922. U8 oversampling_disabled : 1; // When set to 1, oversampling is disabled
  2923. U8 hd_sdi_mode : 1; // when set to 1, HD-SDI mode
  2924. U8 reserved : 1;
  2925. U16 reserved_2;
  2926. U32 cmdReadDly; // Used to indicate the turbo command time related to normal interrrupts.
  2927. // First bit indicate its direction,
  2928. // 1: before the VDSP interrupt, i.e., turbo command deadline is the
  2929. // absolute value of cmdReadDly's audio clk before the next normal interrupts.
  2930. // 0: after the VDSP interrutps, i.e., turbo command deadline is the
  2931. // absolute value of cmdReadDly's audio clk after the next normal interrutps.
  2932. // new fields for preview source window parameters of preview A and B
  2933. // x/y offset is relative to the upper left
  2934. // corner of the Main window.
  2935. U16 preview_src_w_A;
  2936. U16 preview_src_h_A;
  2937. U16 preview_src_x_offset_A;
  2938. U16 preview_src_y_offset_A;
  2939. U16 preview_src_w_B;
  2940. U16 preview_src_h_B;
  2941. U16 preview_src_x_offset_B;
  2942. U16 preview_src_y_offset_B;
  2943. } GD_DSP_CMD_VIDEO_PREPROC_S;
  2944. typedef struct
  2945. {
  2946. // cmd_code: 0x00003002 GD_FAST_AAA_CAPTURE
  2947. U32 cmd_code;
  2948. U16 input_image_width;
  2949. U16 input_image_height;
  2950. U32 start_record_id;
  2951. } GD_DSP_CMD_FAST_AAA_CAPTURE_S;
  2952. typedef struct
  2953. {
  2954. // cmd_code: 0x00003004 GD_H264_ENCODE
  2955. U32 cmd_code;
  2956. U32 bits_fifo_next;
  2957. U32 info_fifo_next;
  2958. U32 start_encode_frame_no;
  2959. U32 encode_duration;
  2960. U8 is_flush;
  2961. U8 enable_slow_shutter;
  2962. U8 res_rate_min; // between 0 and 100
  2963. S8 alpha; // between -6 and 6
  2964. S8 beta; // between -6 and 6
  2965. U8 en_loop_filter; // 1 enable loop filtering.
  2966. U8 max_upsampling_rate;
  2967. U8 slow_shutter_upsampling_rate;
  2968. // SPS
  2969. U8 frame_cropping_flag;
  2970. U8 high_profile : 1;
  2971. U8 reserved2 : 7;
  2972. U16 frame_crop_left_offset;
  2973. U16 frame_crop_right_offset;
  2974. U16 frame_crop_top_offset;
  2975. U16 frame_crop_bottom_offset;
  2976. U8 num_ref_frame;
  2977. U8 log2_max_frame_num_minus4;
  2978. U8 log2_max_pic_order_cnt_lsb_minus4;
  2979. U8 sony_avc : 1;
  2980. U8 reserved : 7;
  2981. U16 height_mjpeg_h264_simultaneous;
  2982. U16 width_mjpeg_h264_simultaneous;
  2983. U16 vui_enable : 1;
  2984. U16 aspect_ratio_info_present_flag : 1;
  2985. U16 overscan_info_present_flag : 1;
  2986. U16 overscan_appropriate_flag : 1;
  2987. U16 video_signal_type_present_flag : 1;
  2988. U16 video_full_range_flag : 1;
  2989. U16 colour_description_present_flag : 1;
  2990. U16 chroma_loc_info_present_flag : 1;
  2991. U16 timing_info_present_flag : 1;
  2992. U16 fixed_frame_rate_flag : 1;
  2993. U16 nal_hrd_parameters_present_flag : 1;
  2994. U16 vcl_hrd_parameters_present_flag : 1;
  2995. U16 low_delay_hrd_flag : 1;
  2996. U16 pic_struct_present_flag : 1;
  2997. U16 bitstream_restriction_flag : 1;
  2998. U16 motion_vectors_over_pic_boundaries_flag : 1;
  2999. // aspect_ratio_info_present_flag
  3000. U16 SAR_width;
  3001. U16 SAR_height;
  3002. // video_signal_type_present_flag
  3003. U8 video_format;
  3004. // colour_description_present_flag
  3005. U8 colour_primaries;
  3006. U8 transfer_characteristics;
  3007. U8 matrix_coefficients;
  3008. // chroma_loc_info_present_flag
  3009. U8 chroma_sample_loc_type_top_field : 4;
  3010. U8 chroma_sample_loc_type_bottom_field : 4;
  3011. U8 aspect_ratio_idc;
  3012. U8 reserved3;
  3013. // bitstream_restriction_flag
  3014. U32 max_bytes_per_pic_denom : 8;
  3015. U32 max_bits_per_mb_denom : 8;
  3016. U32 log2_max_mv_length_horizontal : 8;
  3017. U32 log2_max_mv_length_vertical : 8;
  3018. U16 num_reorder_frames;
  3019. U16 max_dec_frame_buffering;
  3020. U32 I_IDR_sp_rc_handle_mask : 8;
  3021. U32 IDR_QP_adj_str : 8;
  3022. U32 IDR_class_adj_limit : 8;
  3023. U32 reserved_1 : 8;
  3024. U32 I_QP_adj_str : 8;
  3025. U32 I_class_adj_limit : 8;
  3026. U32 firstGOPstartB : 8;
  3027. U32 au_type : 8;
  3028. //tune the AQP and mode bias
  3029. S8 intra16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3030. S8 intra4x4_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3031. S8 inter16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3032. S8 inter8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3033. S8 direct16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3034. S8 direct8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3035. S8 me_lambda_qp_offset;
  3036. S8 reserved4;
  3037. } GD_DSP_CMD_H264_ENCODE_S, GD_DSP_CMD_VID_ENCODE_S;
  3038. typedef struct
  3039. {
  3040. // cmd_code: 0x00003005 GD_H264_ENCODE_FROM_MEMORY
  3041. U32 cmd_code;
  3042. U16 vidcap_w;
  3043. U16 vidcap_h;
  3044. U16 vidcap_pitch;
  3045. U16 main_w;
  3046. U16 main_h;
  3047. U16 encode_w;
  3048. U16 encode_h;
  3049. U16 encode_x;
  3050. U16 encode_y;
  3051. U16 preview_w;
  3052. U16 preview_h;
  3053. U32 input_center_x;
  3054. U32 input_center_y;
  3055. U32 zoom_factor_x;
  3056. U32 zoom_factor_y;
  3057. U8 num_images;
  3058. U32 h264_bits_fifo_start;
  3059. U32 h264_info_fifo_start;
  3060. U32 input_image_addr_Y_UV[8]; //u_long
  3061. } GD_DSP_CMD_H264_ENCODE_FROM_MEMORY_PARAM_S, GD_DSP_CMD_VID_ENCODE_FROM_MEMORY_PARAM_S;
  3062. typedef struct
  3063. {
  3064. // cmd_code: 0x00003006 GD_H264_BITS_FIFO_UPDATE
  3065. U32 cmd_code;
  3066. U32 bits_output_fifo_end;
  3067. } GD_DSP_CMD_H264_ENCODE_BITS_FIFO_UPDATE_S, GD_DSP_CMD_H264_VID_ENCODE_BITS_FIFO_UPDATE_S;
  3068. typedef struct
  3069. {
  3070. // cmd_code: 0x00003007 GD_ENCODING_STOP
  3071. U32 cmd_code;
  3072. U32 stop_method;
  3073. } GD_DSP_CMD_H264_ENCODE_STOP_S, GD_DSP_CMD_VID_ENCODE_STOP_S;
  3074. typedef struct
  3075. {
  3076. // cmd_code: 0x00003008 GD_MODIFY_CMD_DLY
  3077. U32 cmd_code;
  3078. U32 api_proc_delay;
  3079. } GD_DSP_CMD_PROC_DELAY_S, GD_DSP_CMD_VID_PROC_DELAY_T;
  3080. typedef struct
  3081. {
  3082. // cmd_code: 0x00004001 GD_STILL_CAPTURE
  3083. U32 cmd_code;
  3084. U8 output_select;
  3085. U8 input_format;
  3086. U8 vsync_skip;
  3087. U8 resume;
  3088. U32 number_frames_to_capture;
  3089. U16 vidcap_w;
  3090. U16 vidcap_h;
  3091. U16 main_w;
  3092. U16 main_h;
  3093. U16 encode_w;
  3094. U16 encode_h;
  3095. U16 encode_x;
  3096. U16 encode_y;
  3097. U16 preview_w;
  3098. U16 preview_h;
  3099. U16 thumbnail_w;
  3100. U16 thumbnail_h;
  3101. U32 input_center_x;
  3102. U32 input_center_y;
  3103. U32 zoom_factor_x;
  3104. U32 zoom_factor_y;
  3105. U32 jpeg_bits_fifo_start;
  3106. U32 jpeg_info_fifo_start;
  3107. U32 sensor_readout_mode;
  3108. U8 sensor_id;
  3109. U8 field_format;
  3110. U8 sensor_resolution;
  3111. U8 sensor_pattern;
  3112. U8 first_line_field_0;
  3113. U8 first_line_field_1;
  3114. U8 first_line_field_2;
  3115. U8 first_line_field_3;
  3116. U8 first_line_field_4;
  3117. U8 first_line_field_5;
  3118. U8 first_line_field_6;
  3119. U8 first_line_field_7;
  3120. U16 preview_w_B;
  3121. U16 preview_h_B;
  3122. U16 raw_cap_cntl;
  3123. // Added by Colin chen for the High ISO mode of Still processing
  3124. U8 still_process_mode;
  3125. U8 yuv_proc_mode;
  3126. U32 still_process_data_dram_addr;
  3127. U32 raw_cap_hw_rsc_ptr;
  3128. U8 disable_quickview_HDMI : 1;
  3129. U8 disable_quickview_LCD : 1;
  3130. // Used to indicate that we do not need to resetting vin and need to wait
  3131. // out the vin before exiting RJPEG mode to TIMER mode
  3132. U8 no_vin_reset_exiting : 1;
  3133. U8 reserved_1 : 5;
  3134. U8 jpg_enc_cntrl;
  3135. U16 thumbnail_active_h;
  3136. } GD_DSP_CMD_STILL_CAPTURE_S;
  3137. typedef struct
  3138. {
  3139. // cmd_code: 0x00004002 GD_JPEG_ENCODE_RESCALE_FROM_MEMORY
  3140. U32 cmd_code;
  3141. U8 output_select;
  3142. U8 input_format;
  3143. U8 bayer_pattern;
  3144. U8 resolution;
  3145. U32 input_address;
  3146. U32 input_chroma_address;
  3147. U16 input_pitch;
  3148. U16 input_chroma_pitch;
  3149. U16 input_h;
  3150. U16 input_w;
  3151. U16 main_w;
  3152. U16 main_h;
  3153. U16 encode_w;
  3154. U16 encode_h;
  3155. U16 encode_x;
  3156. U16 encode_y;
  3157. U16 preview_w_A;
  3158. U16 preview_h_A;
  3159. U16 thumbnail_w;
  3160. U16 thumbnail_h;
  3161. U32 input_center_x;
  3162. U32 input_center_y;
  3163. U32 zoom_factor_x;
  3164. U32 zoom_factor_y;
  3165. U32 jpeg_bits_fifo_start;
  3166. U32 jpeg_info_fifo_start;
  3167. U16 preview_w_B;
  3168. U16 preview_h_B;
  3169. U16 cap_cntl;
  3170. /*
  3171. #define STILL_PROCESS_MODE_NORMAL 0
  3172. #define STILL_PROCESS_MODE_HIGH_ISO 1
  3173. are defined above.
  3174. Added by Colin chen for the High ISO mode of Still processing
  3175. */
  3176. U8 still_process_mode;
  3177. U8 still_process_mode_padding;
  3178. U32 still_process_data_dram_addr;
  3179. U8 disable_quickview_HDMI : 1;
  3180. U8 disable_quickview_LCD : 1;
  3181. U8 no_vin_reset_exiting : 1; //Used to indicate that we do not need to resetting vin and need to wait
  3182. //out the vin before exiting RJPEG mode to TIMER mode
  3183. U8 reserved_1 : 5;
  3184. U8 reserved;
  3185. U16 thumbnail_active_h;
  3186. } GD_DSP_CMD_STILL_PROC_FROM_MEMORY_S;
  3187. typedef struct
  3188. {
  3189. // cmd_code: 0x00004003 GD_JPEG_BITS_FIFO_UPDATE
  3190. U32 cmd_code;
  3191. U32 bits_fifo_end;
  3192. } GD_DSP_CMD_JPEG_BITS_FIFO_UPDATE_S;
  3193. typedef struct
  3194. {
  3195. // cmd_code: 0x00004004 GD_FREE_RAW_YUV_PIC_BUFFER
  3196. U32 cmd_code;
  3197. U32 number_of_raw_pic_consumed;
  3198. U32 raw_last_addr_consumed;
  3199. U32 number_of_thumbnail_pic_consumed;
  3200. U32 thumbnail_last_addr_consumed;
  3201. U32 number_of_encode_YUV_pic_consumed;
  3202. U32 encode_yuv_last_addr_consumed;
  3203. } GD_DSP_CMD_FREE_RAW_YUV_PICTURE_BUFFER_S;
  3204. typedef struct
  3205. {
  3206. // cmd_code: 0x00004005 GD_JPEG_RAW_YUV_STOP
  3207. U32 cmd_code;
  3208. } GD_DSP_CMD_JPEG_STOP_S;
  3209. typedef struct
  3210. {
  3211. // cmd_code: 0x00004006 GD_MJPEG_ENCODE
  3212. U32 cmd_code;
  3213. U32 bits_fifo_next;
  3214. U32 info_fifo_next;
  3215. U32 start_encode_frame_no;
  3216. U32 encode_duration;
  3217. U8 framerate_control_M;
  3218. U8 framerate_control_N;
  3219. U16 reserve;
  3220. } GD_DSP_CMD_MJPEG_CAPTURE_S;
  3221. typedef struct
  3222. {
  3223. // cmd_code: 0x00004007 GD_VID_FADE_IN_OUT
  3224. U32 cmd_code;
  3225. // 0: fade in start, 1: fade in stop, 2: fade out start, 3: fade out stop
  3226. U8 cmd;
  3227. } GD_DSP_CMD_VID_FADE_IN_OUT_S;
  3228. typedef struct
  3229. {
  3230. // cmd_code: 0x00004008 GD_MJPEG_ENCODE_WITH_H264
  3231. U32 cmd_code;
  3232. U32 enable;
  3233. } GD_DSP_CMD_MJPEG_CAPTURE_WITH_264_S;
  3234. typedef struct
  3235. {
  3236. // cmd_code: 0x00004009 GD_OSD_INSERT
  3237. U32 cmd_code;
  3238. U32 enable;
  3239. U32 y_osd_addr_h264;
  3240. U32 uv_osd_addr_h264;// 420
  3241. U16 osd_width_h264;
  3242. U16 osd_pitch_h264;
  3243. U16 osd_height_h264;
  3244. U16 osd_vertical_position_h264;
  3245. U32 y_osd_addr_mjpeg;
  3246. U32 uv_osd_addr_mjpeg;//422
  3247. U16 osd_width_mjpeg;
  3248. U16 osd_pitch_mjpeg;
  3249. U16 osd_height_mjpeg;
  3250. U16 osd_vertical_position_mjpeg;
  3251. } GD_DSP_CMD_OSD_INSERT_S;
  3252. typedef struct
  3253. {
  3254. // cmd_code: 0x00004010 GD_YUV422_CAPTURE
  3255. U32 cmd_code;
  3256. U32 num2Capture;
  3257. } GD_DSP_CMD_YUV422_CAPTURE_S;
  3258. typedef struct
  3259. {
  3260. // cmd_code: 0x00004011 GD_SEND_CAVLC_RESULT
  3261. U32 cmd_code;
  3262. U32 num_of_cavlc_results: 8;
  3263. U32 pjpg_rd_size : 24;
  3264. U32 cavlcBits_A[6];
  3265. U32 cavlcBits_B[6];
  3266. U32 cavlcBits_C[6];
  3267. U32 cavlcBits_D[6];
  3268. U32 totCavlcBits[6];
  3269. } GD_DSP_CMD_CAVLC_RESULT_S;
  3270. typedef struct
  3271. {
  3272. // cmd_code: 0x00004012 GD_STILL_CAPTURE_IN_REC
  3273. U32 cmd_code;
  3274. U16 main_jpg_w;
  3275. U16 main_jpg_h;
  3276. U16 encode_w;
  3277. U16 encode_h;
  3278. U16 encode_x;
  3279. U16 encode_y;
  3280. U16 blank_period_duration; // absolute duration, time unit: 1/60000 second.
  3281. U8 is_use_compaction; // if compaction is needed
  3282. U8 is_thumbnail_ena;
  3283. } GD_DSP_CMD_STILL_CAP_IN_REC_S;
  3284. typedef struct
  3285. {
  3286. // cmd_code: 0x00004013 GD_OSD_BLEND
  3287. U32 cmd_code;
  3288. U8 chan_id;
  3289. U8 stream_id;
  3290. U8 enable;
  3291. U8 still_osd;
  3292. U32 osd_addr_y;
  3293. U32 osd_addr_uv;
  3294. U32 alpha_addr_y; // alpha mask must be the same size as osd, (osd_width*osd_height), value 0~0xff
  3295. U32 alpha_addr_uv;
  3296. U16 osd_width;
  3297. U16 osd_pitch;
  3298. U16 osd_height;
  3299. U16 osd_start_x; // (start_x, start_y)=(0,0) refers to top-left pixel of main image.
  3300. U16 osd_start_y;
  3301. U16 reserved_2;
  3302. U8 blend_area2_enable;
  3303. U8 reserved_3;
  3304. U16 blend_area2_width;
  3305. U16 blend_area2_pitch;
  3306. U16 blend_area2_height;
  3307. U16 blend_area2_start_x;
  3308. U16 blend_area2_start_y;
  3309. U32 blend_area2_y_addr;
  3310. U32 blend_area2_uv_addr;
  3311. U32 blend_area2_alpha_addr;
  3312. U8 blend_area3_enable;
  3313. U8 reserved_4;
  3314. U16 blend_area3_width;
  3315. U16 blend_area3_pitch;
  3316. U16 blend_area3_height;
  3317. U16 blend_area3_start_x;
  3318. U16 blend_area3_start_y;
  3319. U32 blend_area3_y_addr;
  3320. U32 blend_area3_uv_addr;
  3321. U32 blend_area3_alpha_addr;
  3322. } GD_DSP_CMD_OSD_BLEND_S;
  3323. typedef struct
  3324. {
  3325. // cmd_code: 0x00004014 GD_INTERVAL_CAPTURE
  3326. U32 cmd_code;
  3327. U32 action;
  3328. U32 num_of_frame;
  3329. } GD_DSP_CMD_INTERVAL_CAP_S;
  3330. typedef struct
  3331. {
  3332. // cmd_code: 0x00004015 GD_STILL_CAPTURE_ADV
  3333. U32 cmd_code;
  3334. } GD_DSP_CMD_STILL_CAPTURE_ADV_S;
  3335. /*-------------------------------------------------
  3336. * H264/JPEG decoding mode
  3337. * 1. H264 decode (0x00005002)
  3338. * 2. JPEG decode (0x00005003)
  3339. * 3. RAW picture decode (0x00005004)
  3340. * 4. Rescale Postprocessing (0x00005005)
  3341. * 5. H264 decode bits FIFO update (0x00005006)
  3342. * 6. H264 playback speed (0x00005007)
  3343. * 7. H264 trickplay (0x00005008)
  3344. * 8. Decode stop (0x00005009)
  3345. * 9. Multi-scene decode (0x00005010)
  3346. * 10. Capture video picture (0x00005011)
  3347. -------------------------------------------------*/
  3348. typedef struct
  3349. {
  3350. // cmd_code: 0x00005002 GD_H264_DECODE
  3351. U32 cmd_code;
  3352. U32 bits_fifo_start;
  3353. U32 bits_fifo_end;
  3354. U32 num_pics;
  3355. U32 num_frame_decode;
  3356. U32 first_frame_display;
  3357. U32 fade_in_on;
  3358. U32 fade_out_on;
  3359. } GD_DSP_CMD_H264_DECODE_S;
  3360. typedef struct
  3361. {
  3362. // cmd_code: 0x00005003 GD_JPEG_DECODE
  3363. U32 cmd_code;
  3364. U32 bits_fifo_start;
  3365. U32 bits_fifo_end;
  3366. U8 main_rotation;
  3367. U8 ycbcr_position;
  3368. U16 reserved;
  3369. U32 frame_duration;
  3370. U32 num_frame_decode;
  3371. U8 already_decoded;
  3372. U8 sec_rotation;
  3373. } GD_DSP_CMD_JPEG_DECODE_S;
  3374. typedef struct
  3375. {
  3376. // cmd_code: 0x00005004 GD_RAW_PICTURE_DECODE
  3377. U32 cmd_code;
  3378. U32 raw_pic_addr;
  3379. U16 input_width;
  3380. U16 input_height;
  3381. U16 input_pitch;
  3382. U8 rotation;
  3383. U8 bayer_pattern;
  3384. U8 resolution;
  3385. U8 already_decoded;
  3386. } GD_DSP_CMD_RAW_PIC_DECODE_S;
  3387. typedef struct
  3388. {
  3389. // cmd_code: 0x00005005 GD_RESCALE_POSTPROCESSING
  3390. U32 cmd_code;
  3391. U16 input_center_x;
  3392. U16 input_center_y;
  3393. U16 display_win_offset_x;
  3394. U16 display_win_offset_y;
  3395. U16 display_win_width;
  3396. U16 display_win_height;
  3397. U32 zoom_factor_x;
  3398. U32 zoom_factor_y;
  3399. U8 apply_yuv;
  3400. U8 apply_luma;
  3401. U8 apply_noise;
  3402. U8 pip_enable;
  3403. U16 pip_x_offset;
  3404. U16 pip_y_offset;
  3405. U16 pip_x_size;
  3406. U16 pip_y_size;
  3407. U16 sec_display_win_offset_x;
  3408. U16 sec_display_win_offset_y;
  3409. U16 sec_display_win_width;
  3410. U16 sec_display_win_height;
  3411. U32 sec_zoom_factor_x;
  3412. U32 sec_zoom_factor_y;
  3413. U32 reserved : 31;
  3414. U32 animated_rotation : 1;
  3415. U32 warp_horizontal_table_address;
  3416. U32 warp_vertical_table_address;
  3417. U8 grid_array_width;
  3418. U8 grid_array_height;
  3419. U8 horz_grid_spacing_exponent;
  3420. U8 vert_grid_spacing_exponent;
  3421. U8 vert_warp_grid_array_width;
  3422. U8 vert_warp_grid_array_height;
  3423. U8 vert_warp_horz_grid_spacing_exponent;
  3424. U8 vert_warp_vert_grid_spacing_exponent;
  3425. } GD_DSP_CMD_RESCALE_POSTPROC_S;
  3426. typedef struct
  3427. {
  3428. // cmd_code: 0x00005006 GD_H264_DECODE_BITS_FIFO_UPDATE
  3429. U32 cmd_code;
  3430. U32 bits_fifo_start;
  3431. U32 bits_fifo_end;
  3432. U32 num_pics;
  3433. } GD_DSP_CMD_H264_DECODE_BITS_FIFO_UPDATE_S;
  3434. typedef struct
  3435. {
  3436. // cmd_code: 0x00005007 GD_H264_PLAYBACK_SPEED
  3437. U32 cmd_code;
  3438. U16 speed;
  3439. U8 scan_mode;
  3440. U8 direction;
  3441. } GD_DSP_CMD_H264_PLAYBACK_SPEED_S;
  3442. typedef struct
  3443. {
  3444. // cmd_code: 0x00005008 GD_H264_TRICKPLAY
  3445. U32 cmd_code;
  3446. U8 mode;
  3447. } GD_DSP_CMD_H264_TRICKPLAY_S;
  3448. typedef struct
  3449. {
  3450. // cmd_code: 0x00005009 GD_DECODE_STOP
  3451. U32 cmd_code;
  3452. U8 stop_flag;
  3453. } GD_DSP_CMD_H264_DECODE_STOP_S;
  3454. typedef struct
  3455. {
  3456. S16 offset_x; //for TV
  3457. S16 offset_y;
  3458. U16 width;
  3459. U16 height;
  3460. S16 sec_offset_x; //for LCD
  3461. S16 sec_offset_y;
  3462. U16 sec_width;
  3463. U16 sec_height;
  3464. U32 source_base;
  3465. U32 source_size : 24;
  3466. U32 source_type : 4;
  3467. U32 rotation : 4; // for main rotation
  3468. U32 thumbnail_id : 8;
  3469. U32 decode_only : 4;
  3470. U32 sec_rotation : 4; // for LCD rotation
  3471. U32 reserved : 16;
  3472. } GD_DSP_CMD_SCENE_STRUCTURE_S;
  3473. typedef struct
  3474. {
  3475. // cmd_code: 0x00005010 GD_MULTI_SCENE_DECODE
  3476. U32 cmd_code;
  3477. U32 total_scenes : 8;
  3478. U32 start_scene_num : 8;
  3479. U32 scene_num : 8;
  3480. U32 end : 4;
  3481. U32 fast_mode : 4;
  3482. GD_DSP_CMD_SCENE_STRUCTURE_S scene[4];
  3483. } GD_DSP_CMD_MULTI_SCENE_DECODE_S;
  3484. typedef struct
  3485. {
  3486. U32 cmd_code;
  3487. // cmd_code: 0x00005011 GD_CAPTURE_VIDEO_PICTURE
  3488. U32 coded_pic_base;
  3489. U32 coded_pic_limit;
  3490. U32 thumbnail_pic_base;
  3491. U32 thumbnail_pic_limit;
  3492. U16 thumbnail_width;
  3493. U16 thumbnail_height;
  3494. U16 thumbnail_letterbox_strip_width;
  3495. U16 thumbnail_letterbox_strip_height;
  3496. U8 thumbnail_letterbox_strip_y;
  3497. U8 thumbnail_letterbox_strip_cb;
  3498. U8 thumbnail_letterbox_strip_cr;
  3499. U8 reserved0;
  3500. U32 quant_matrix_addr;
  3501. U16 target_pic_width;
  3502. U16 target_pic_height;
  3503. U32 pic_structure : 8;
  3504. U32 reserved1 : 24;
  3505. U32 screennail_pic_base;
  3506. U32 screennail_pic_limit;
  3507. U16 screennail_width;
  3508. U16 screennail_height;
  3509. U16 screennail_letterbox_strip_width;
  3510. U16 screennail_letterbox_strip_height;
  3511. U8 screennail_letterbox_strip_y;
  3512. U8 screennail_letterbox_strip_cb;
  3513. U8 screennail_letterbox_strip_cr;
  3514. U8 reserved2;
  3515. } GD_DSP_CMD_CAPTURE_VIDEO_PIC_S;
  3516. typedef struct
  3517. {
  3518. // cmd_code: 0x00005012 GD_CAPTURE_STILL_PICTURE
  3519. U32 cmd_code;
  3520. U32 coded_pic_base; /*DRAM address to hold JPEG to encode */
  3521. U32 coded_pic_limit;
  3522. U32 thumbnail_pic_base; /*DRAM address to store JPEG in thumbnail form */
  3523. U32 thumbnail_pic_limit;
  3524. U16 thumbnail_width;
  3525. U16 thumbnail_height;
  3526. U16 thumbnail_letterbox_strip_width; /*will change order when it's finalized */
  3527. U16 thumbnail_letterbox_strip_height;
  3528. U8 thumbnail_letterbox_strip_y; /*Y value for painting letterbox */
  3529. U8 thumbnail_letterbox_strip_cb; /*Cb value for painting letterbox */
  3530. U8 thumbnail_letterbox_strip_cr; /*Cr value for painting letterbox */
  3531. U8 capture_multi_scene; /* capture the multi scene picture */
  3532. U32 quant_matrix_addr; /*DRAM address to hold quant matrix, refer to capture_video_pic_s*/
  3533. U32 screennail_pic_base; /*DRAM address to store JPEG in screennail form */
  3534. U32 screennail_pic_limit;
  3535. U16 screennail_width;
  3536. U16 screennail_height;
  3537. U16 screennail_letterbox_strip_width; /*will change order when it's finalized */
  3538. U16 screennail_letterbox_strip_height;
  3539. U8 screennail_letterbox_strip_y; /*Y value for painting letterbox */
  3540. U8 screennail_letterbox_strip_cb; /*Cb value for painting letterbox */
  3541. U8 screennail_letterbox_strip_cr; /*Cr value for painting letterbox */
  3542. U8 reserved0;
  3543. U16 input_offset_x; /* offset x to crop the input picture */
  3544. U16 input_offset_y; /* offset y to crop the input picture */
  3545. U16 input_width; /* default=0: capture original size */
  3546. U16 input_height; /* default=0 */
  3547. U16 target_pic_width; /* regular capture width */
  3548. U16 target_pic_height; /* regular capture height */
  3549. } GD_DSP_CMD_CAPTURE_STILL_PIC_S;
  3550. typedef struct
  3551. {
  3552. // cmd_code: 0x00005013 GD_JPEG_FREEZE
  3553. U32 cmd_code;
  3554. U8 freeze_state;
  3555. U8 reserved[3];
  3556. } GD_DSP_CMD_JPEG_FREEZE_S;
  3557. typedef struct
  3558. {
  3559. // cmd_code: 0x00005014 GD_MULTI_SCENE_SETUP
  3560. U32 cmd_code;
  3561. U8 if_save_thumbnail; /* indicate if we need to allocate a regular thumbnail buffer*/
  3562. U8 total_thumbnail;
  3563. U16 saving_thumbnail_width;
  3564. U16 saving_thumbnail_height;
  3565. U8 if_save_large_thumbnail; /* indicate if we need to allocate a large size thumbnail buffer*/
  3566. U8 total_large_thumbnail;
  3567. U16 saving_large_thumbnail_width;
  3568. U16 saving_large_thumbnail_height;
  3569. U8 if_capture_large_size_thumbnail; /* indicate if we need to capture a large size multi scene picture */
  3570. U8 reserved;
  3571. U16 large_thumbnail_pic_width; /* picture width of large size multi-scene */
  3572. U16 large_thumbnail_pic_height; /* picture height of large size multi-scene */
  3573. U8 visual_effect_type; /* special effect type */
  3574. U8 reserved1;
  3575. U16 extra_total_thumbnail; /*number of thumnails if total > 1000 */
  3576. } GD_DSP_CMD_MULTI_SCENE_SETUP_S;
  3577. typedef struct
  3578. {
  3579. S16 input_offset_x; //for input cropping
  3580. S16 input_offset_y;
  3581. U16 input_width;
  3582. U16 input_height;
  3583. S16 main_output_offset_x; //for TV
  3584. S16 main_output_offset_y;
  3585. U16 main_output_width;
  3586. U16 main_output_height;
  3587. S16 sec_output_offset_x; //for LCD
  3588. S16 sec_output_offset_y;
  3589. U16 sec_output_width;
  3590. U16 sec_output_height;
  3591. U32 source_base;
  3592. U32 source_size : 24;
  3593. U32 source_type : 4;
  3594. U32 rotation : 4;
  3595. U32 thumbnail_id : 8;
  3596. U32 decode_only : 4;
  3597. U32 luma_gain : 8; // for luma scaling
  3598. U32 thumbnail_type : 2; // indicate different thumbnail size, 0: small size thumbnail 1: large size thumbnail.
  3599. U32 reserved : 10;
  3600. } GD_DSP_CMD_SCENE_STRUCTURE_ADV_S;
  3601. typedef struct
  3602. {
  3603. // cmd_code: 0x00005015 GD_MULTI_SCENE_DECODE_ADV
  3604. U32 cmd_code;
  3605. U32 total_scenes : 8;
  3606. U32 start_scene_num : 8;
  3607. U32 scene_num : 8;
  3608. U32 end : 4;
  3609. U32 buffer_source_only : 2; // indicate if the scene source is TYPE3=YUV_PIC only
  3610. U32 fast_mode : 2;
  3611. GD_DSP_CMD_SCENE_STRUCTURE_ADV_S scene[3];
  3612. } GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_S;
  3613. typedef struct
  3614. {
  3615. // cmd_code: 0x00005016 GD_JPEG_DECODE_THUMBNAIL_WARP
  3616. U32 cmd_code;
  3617. // src and dst thumbnail id
  3618. U8 src_thm_id;
  3619. U8 dst_thm_id;
  3620. U16 origin_height;
  3621. U16 mirror_height;
  3622. U16 reserved;
  3623. // if draw border on src thumbnail buffer
  3624. U8 if_draw_border;
  3625. U8 border_y;
  3626. U8 border_u;
  3627. U8 border_v;
  3628. // mirror
  3629. U8 if_mirror_effect;
  3630. U8 mirror_luma_gain;
  3631. //warp related field
  3632. U8 horz_warp_control;
  3633. U8 vert_warp_control;
  3634. U32 warp_horizontal_table_address;
  3635. U32 warp_vertical_table_address;
  3636. U8 grid_array_width;
  3637. U8 grid_array_height;
  3638. U8 horz_grid_spacing_exponent;
  3639. U8 vert_grid_spacing_exponent;
  3640. U8 vert_warp_grid_array_width;
  3641. U8 vert_warp_grid_array_height;
  3642. U8 vert_warp_horz_grid_spacing_exponent;
  3643. U8 vert_warp_vert_grid_spacing_exponent;
  3644. } GD_DSP_CMD_JPEG_DECODE_THUMBNAIL_WARP_S;
  3645. typedef struct
  3646. {
  3647. S16 input_offset_x; //for input cropping
  3648. S16 input_offset_y;
  3649. U16 input_width;
  3650. U16 input_height;
  3651. S16 main_output_offset_x; //for TV
  3652. S16 main_output_offset_y;
  3653. U16 main_output_width;
  3654. U16 main_output_height;
  3655. S16 sec_output_offset_x; //for LCD
  3656. S16 sec_output_offset_y;
  3657. U16 sec_output_width;
  3658. U16 sec_output_height;
  3659. U32 source_base;
  3660. U32 source_size : 24;
  3661. U32 source_type : 4;
  3662. U32 main_rotation : 4;
  3663. U32 sec_rotation : 4;
  3664. U32 thumbnail_id : 11; // to support 2048 thumbnails
  3665. U32 decode_only : 1;
  3666. U32 luma_gain : 8; // for luma scaling
  3667. U32 thumbnail_type : 2; // indicate different thumbnail size, 0: small size thumbnail 1: large size thumbnail.
  3668. U32 reserved : 6;
  3669. } GD_DSP_CMD_SCENE_STRUCTURE_ADV_2_S;
  3670. typedef struct
  3671. {
  3672. // cmd_code: 0x00005017 GD_MULTI_SCENE_DECODE_ADV_2
  3673. U32 cmd_code;
  3674. U32 total_scenes : 8;
  3675. U32 start_scene_num : 8;
  3676. U32 scene_num : 8;
  3677. U32 end : 1;
  3678. U32 update_lcd_only : 1; //indicate if we only update lcd
  3679. U32 buffer_source_only : 1; // indicate if the scene source is TYPE3=YUV_PIC only
  3680. U32 fast_mode : 1;
  3681. U32 reserved : 4;
  3682. GD_DSP_CMD_SCENE_STRUCTURE_ADV_2_S scene[3];
  3683. } GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_2_S;
  3684. /*-------------------------------------------------
  3685. -------------------------------------------------*/
  3686. typedef struct
  3687. {
  3688. // cmd_code: 0x00006001 GD_IPCAM_VIDEO_PREPROCESSING
  3689. U32 cmd_code;
  3690. U32 input_format: 8;
  3691. U32 sensor_id : 8;
  3692. U32 keep_states : 8;
  3693. U32 reserved1 : 8;
  3694. U32 vin_frame_rate;
  3695. U16 vidcap_w;
  3696. U16 vidcap_h;
  3697. U32 input_center_x;
  3698. U32 input_center_y;
  3699. U32 zoom_factor_x;
  3700. U32 zoom_factor_y;
  3701. U32 aaa_data_fifo_start;
  3702. U32 sensor_readout_mode;
  3703. U8 noise_filter_strength;
  3704. U8 image_stabilize_strength;
  3705. U8 bit_resolution;
  3706. U8 bayer_pattern;
  3707. U8 preview_format_A : 4;
  3708. U8 preview_format_B : 3;
  3709. U8 no_pipelineflush : 1;
  3710. U8 preview_frame_rate_A;
  3711. U8 preview_frame_rate_B;
  3712. U8 preview_A_en : 4; // 0: dram, 1: smem
  3713. U8 preview_B_en : 4; // 0: dram, 1: smem
  3714. U16 horizontal_channel_number; // number of channels (streams) displayed on horizontal direction in preview window.
  3715. U16 vertical_channel_number; //number of channels (streams) displayed on vertical direction in preview window.
  3716. U32 vdsp_int_factor : 8;
  3717. U32 main_out_frame_type : 1;
  3718. U32 reserved2 : 23;
  3719. } GD_DSP_CMD_IPCAM_VIDEO_PREPROC_S;
  3720. typedef struct
  3721. {
  3722. // cmd_code: 0x00006002 GD_IPCAM_VIDEO_CAPTURE_PREVIEW_SIZE_SETUP
  3723. U32 cmd_code;
  3724. U32 capture_source : 2;
  3725. U32 output_scan_format : 1;
  3726. U32 deinterlace_mode : 2;
  3727. U32 disabled : 1;
  3728. U32 Reserved1 : 26;
  3729. U16 cap_width;
  3730. U16 cap_height;
  3731. U16 input_win_offset_x;
  3732. U16 input_win_offset_y;
  3733. U16 input_win_width;
  3734. U16 input_win_height;
  3735. } GD_DSP_CMD_IPCAM_CAPTURE_PREVIEW_SIZE_SETUP_S;
  3736. typedef struct
  3737. {
  3738. // cmd_code: 0x00006003 GD_IPCAM_VIDEO_ENCODE_SIZE_SETUP
  3739. U32 cmd_code;
  3740. U32 capture_source : 2;
  3741. U32 Reserved1 : 30;
  3742. U16 enc_x;
  3743. U16 enc_y;
  3744. U16 enc_width;
  3745. U16 enc_height;
  3746. } GD_DSP_CMD_IPCAM_VIDEO_ENCODE_SIZE_SETUP_S;
  3747. typedef struct
  3748. {
  3749. // cmd_code: 0x00006004 GD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP
  3750. U32 cmd_code;
  3751. U32 enable_flags;
  3752. U32 cbr_modify;
  3753. U32 custom_encoder_frame_rate;
  3754. U8 frame_rate_division_factor;
  3755. U8 qp_min_on_I;
  3756. U8 qp_max_on_I;
  3757. U8 qp_min_on_P;
  3758. U8 qp_max_on_P;
  3759. U8 qp_min_on_B;
  3760. U8 qp_max_on_B;
  3761. U8 aqp;
  3762. U8 frame_rate_multiplication_factor;
  3763. U8 i_qp_reduce;
  3764. U8 skip_flags;
  3765. U8 M;
  3766. U8 N;
  3767. U8 p_qp_reduce;
  3768. U8 intra_refresh_num_mb_row;
  3769. U8 preview_A_frame_rate_divison_factor;
  3770. U32 idr_interval;
  3771. U32 custom_vin_frame_rate;
  3772. U32 roi_daddr;
  3773. S8 roi_delta[GD_NUM_PIC_TYPES][4]; /* 3 num pic types and 4 categories */
  3774. U32 panic_div : 8;
  3775. U32 is_monochrome : 1;
  3776. U32 scene_change_detect_on : 1;
  3777. U32 reserved : 22;
  3778. U32 pic_size_control;
  3779. U32 quant_matrix_addr;
  3780. U16 P_IntraBiasAdd;
  3781. U16 B_IntraBiasAdd; //tune the AQP and mode bias
  3782. S8 intra16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3783. S8 intra4x4_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3784. S8 inter16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3785. S8 inter8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3786. S8 direct16x16_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3787. S8 direct8x8_bias; // -64~64, clamp the negative value to -64 to avoid underflow
  3788. S8 me_lambda_qp_offset;
  3789. U8 reserved1;
  3790. //S8 aqp_strength; // 0: Automatic = existing code, 1-81: fixed strength; 1 for no AQP; -1 for inverse AQP
  3791. //tune the deblocking parameters
  3792. S8 alpha; // between -6 and 6
  3793. S8 beta; // between -6 and 6
  3794. U16 reserved2;
  3795. } GD_DSP_CMD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP_S;
  3796. typedef struct
  3797. {
  3798. // cmd_code: 0x00006005 GD_IPCAM_VIDEO_FORCED_IDR
  3799. U32 cmd_code;
  3800. U8 force_idr;
  3801. U8 reserved[3];
  3802. } GD_DSP_CMD_FORCE_IDR_S;
  3803. typedef struct
  3804. {
  3805. // cmd_code: 0x00006006 GD_IPCAM_VIDEO_SYSTEM_SETUP
  3806. U32 cmd_code;
  3807. U16 main_max_width;
  3808. U16 main_max_height;
  3809. U16 preview_A_max_width;
  3810. U16 preview_A_max_height;
  3811. U16 preview_B_max_width;
  3812. U16 preview_B_max_height;
  3813. U16 preview_C_max_width;
  3814. U16 preview_C_max_height;
  3815. U8 stream_0_max_GOP_M;
  3816. U8 stream_1_max_GOP_M;
  3817. U8 stream_2_max_GOP_M;
  3818. U8 stream_3_max_GOP_M;
  3819. U8 stream_0_max_GOP_N;
  3820. U8 stream_1_max_GOP_N;
  3821. U8 stream_2_max_GOP_N;
  3822. U8 stream_3_max_GOP_N;
  3823. U8 stream_0_max_advanced_quality_model;
  3824. U8 stream_1_max_advanced_quality_model;
  3825. U8 stream_2_max_advanced_quality_model;
  3826. U8 stream_3_max_advanced_quality_model;
  3827. U16 stream_0_max_width;
  3828. U16 stream_0_max_height;
  3829. U16 stream_1_max_width;
  3830. U16 stream_1_max_height;
  3831. U16 stream_2_max_width;
  3832. U16 stream_2_max_height;
  3833. U16 stream_3_max_width;
  3834. U16 stream_3_max_height;
  3835. U32 MCTF_possible : 1;
  3836. U32 max_num_streams : 3;
  3837. U32 max_num_cap_sources : 2;
  3838. U32 use_1Gb_DRAM_config : 1;
  3839. U32 reserved1 : 25;
  3840. U16 raw_max_width;
  3841. U16 raw_max_height;
  3842. } GD_DSP_CMD_IPCAM_VIDEO_SYSTEM_SETUP_S;
  3843. typedef struct
  3844. {
  3845. // cmd_code: 0x00006007 GD_IPCAM_OSD_INSERT
  3846. U32 cmd_code;
  3847. U32 vout_id : 1;
  3848. U32 osd_enable : 1;
  3849. U32 osd_num_regions : 2;
  3850. U32 reserved1 : 28;
  3851. U32 osd_clut_dram_address[3];
  3852. U32 osd_buf_dram_address[3];
  3853. U16 osd_buf_pitch[3];
  3854. U16 osd_win_offset_x[3];
  3855. U16 osd_win_offset_y[3];
  3856. U16 osd_win_w[3];
  3857. U16 osd_win_h[3];
  3858. U16 reserved2;
  3859. } GD_DSP_CMD_IPCAM_OSD_INSERT_S;
  3860. typedef struct
  3861. {
  3862. // cmd_code: 0x00006008 GD_IPCAM_SET_PRIVACY_MASK
  3863. U32 cmd_code;
  3864. U32 enabled_flags_dram_address ;
  3865. // use privacy mask to label a region to let MCTF to pass through it
  3866. U8 Y;
  3867. U8 U;
  3868. U8 V;
  3869. } GD_DSP_CMD_IPCAM_SET_PRIVACY_MASK_S;
  3870. typedef struct
  3871. {
  3872. // cmd_code: 0x00006009 GD_IPCAM_QP_RATIO
  3873. U32 cmd_code;
  3874. U8 iframe_numerator;
  3875. U8 iframe_denominator;
  3876. U8 bframe_numerator;
  3877. U8 bframe_denominator;
  3878. U8 pframe_numerator;
  3879. U8 pframe_denominator;
  3880. U16 reserved;
  3881. } GD_DSP_CMD_IPCAM_QP_RATIO_S;
  3882. /*-------------------------------------------------
  3883. -------------------------------------------------*/
  3884. typedef struct
  3885. {
  3886. // cmd_code: 0x00007001 GD_VOUT_MIXER_SETUP
  3887. U32 cmd_code;
  3888. U16 vout_id;
  3889. U8 interlaced;
  3890. U8 frm_rate;
  3891. U16 act_win_width;
  3892. U16 act_win_height;
  3893. U8 back_ground_v;
  3894. U8 back_ground_u;
  3895. U8 back_ground_y;
  3896. U8 reserved;
  3897. U8 highlight_v;
  3898. U8 highlight_u;
  3899. U8 highlight_y;
  3900. U8 highlight_thresh;
  3901. } GD_DSP_CMD_VOUT_MIXER_SETUP_S;
  3902. typedef struct
  3903. {
  3904. // cmd_code: 0x00007002 GD_VOUT_VIDEO_SETUP
  3905. U32 cmd_code;
  3906. U16 vout_id;
  3907. U8 en;
  3908. U8 src;
  3909. U8 flip;
  3910. U8 rotate;
  3911. U8 data_src;
  3912. U8 reserved;
  3913. U16 win_offset_x;
  3914. U16 win_offset_y;
  3915. U16 win_width;
  3916. U16 win_height;
  3917. U32 default_img_y_addr;
  3918. U32 default_img_uv_addr;
  3919. U16 default_img_pitch;
  3920. U8 default_img_repeat_field;
  3921. U8 reserved2;
  3922. } GD_DSP_CMD_VOUT_VIDEO_SETUP_S;
  3923. typedef struct
  3924. {
  3925. // cmd_code: 0x00007003 GD_VOUT_DEFAULT_IMG_SETUP
  3926. U32 cmd_code;
  3927. U16 vout_id;
  3928. U16 reserved;
  3929. U32 default_img_y_addr;
  3930. U32 default_img_uv_addr;
  3931. U16 default_img_pitch;
  3932. U8 default_img_repeat_field;
  3933. U8 reserved2;
  3934. } GD_DSP_CMD_VOUT_DEFAULT_IMG_SETUP_S;
  3935. typedef struct
  3936. {
  3937. // cmd_code: 0x00007004 GD_VOUT_OSD_SETUP
  3938. U32 cmd_code;
  3939. U16 vout_id;
  3940. U8 en;
  3941. U8 src;
  3942. U8 flip;
  3943. U8 rescaler_en;
  3944. U8 premultiplied;
  3945. U8 global_blend;
  3946. U16 win_offset_x;
  3947. U16 win_offset_y;
  3948. U16 win_width;
  3949. U16 win_height;
  3950. U16 rescaler_input_width;
  3951. U16 rescaler_input_height;
  3952. U32 osd_buf_dram_addr;
  3953. U16 osd_buf_pitch;
  3954. U8 osd_buf_repeat_field;
  3955. U8 osd_direct_mode;
  3956. U16 osd_transparent_color;
  3957. U8 osd_transparent_color_en;
  3958. U8 reserved;
  3959. U32 osd_buf_info_dram_addr;//24
  3960. } GD_DSP_CMD_VOUT_OSD_SETUP_S;
  3961. typedef struct
  3962. {
  3963. // cmd_code: 0x00007005 GD_VOUT_OSD_BUFFER_SETUP
  3964. U32 cmd_code;
  3965. U16 vout_id;
  3966. U16 reserved;
  3967. U32 osd_buf_dram_addr;
  3968. U16 osd_buf_pitch;
  3969. U8 osd_buf_repeat_field;
  3970. U8 reserved2;
  3971. } GD_DSP_CMD_VOUT_OSD_BUF_SETUP_S;
  3972. typedef struct
  3973. {
  3974. // cmd_code: 0x00007006 GD_VOUT_OSD_CLUT_SETUP
  3975. U32 cmd_code;
  3976. U16 vout_id;
  3977. U16 reserved;
  3978. U32 clut_dram_addr;
  3979. } GD_DSP_CMD_VOUT_OSD_CLUT_SETUP_S;
  3980. typedef struct
  3981. {
  3982. // cmd_code: 0x00007007 GD_VOUT_DISPLAY_SETUP
  3983. U32 cmd_code;
  3984. U16 vout_id;
  3985. U16 reserved;
  3986. U32 disp_config_dram_addr;
  3987. } GD_DSP_CMD_VOUT_DISPLAY_SETUP_S;
  3988. typedef struct
  3989. {
  3990. // cmd_code: 0x00007008 GD_VOUT_DVE_SETUP
  3991. U32 cmd_code;
  3992. U16 vout_id;
  3993. U16 reserved;
  3994. U32 dve_config_dram_addr;
  3995. } GD_DSP_CMD_VOUT_DVE_SETUP_S;
  3996. typedef struct
  3997. {
  3998. // cmd_code: 0x00007009 GD_VOUT_RESET
  3999. U32 cmd_code;
  4000. U16 vout_id;
  4001. U8 reset_mixer;
  4002. U8 reset_disp;
  4003. } GD_DSP_CMD_VOUT_RESET_S;
  4004. typedef struct
  4005. {
  4006. // cmd_code: 0x0000700A GD_VOUT_DISPLAY_CSC_SETUP
  4007. U32 cmd_code;
  4008. U16 vout_id;
  4009. U16 csc_type; // 0: digital; 1: analog; 2: hdmi
  4010. U32 csc_parms[9];
  4011. } GD_DSP_CMD_VOUT_DISPLAY_CSC_SETUP_S;
  4012. typedef struct
  4013. {
  4014. // cmd_code: 0x0000700B GD_VOUT_DIGITAL_OUTPUT_MODE_SETUP
  4015. U32 cmd_code;
  4016. U16 vout_id;
  4017. U16 reserved;
  4018. U32 output_mode;
  4019. } GD_DSP_CMD_VOUT_DIGITAL_OUTPUT_MODE_SETUP_S;
  4020. /*-------------------------------------------------
  4021. experimental commands
  4022. -------------------------------------------------*/
  4023. typedef struct
  4024. {
  4025. // cmd_code: 0x0000f001 GD_CFA_NOISE_FILTER
  4026. U32 cmd_code;
  4027. U32 enable;
  4028. U32 center_weight_red;
  4029. U32 center_weight_green;
  4030. U32 center_weight_blue;
  4031. U32 thresh_red;
  4032. U32 thresh_green;
  4033. U32 thresh_blue;
  4034. } GD_DSP_CMD_CFA_NOISE_FILTER_S;
  4035. typedef struct
  4036. {
  4037. // cmd_code: 0x0000f002 GD_DIGITAL_GAIN_SATURATION
  4038. U32 cmd_code;
  4039. U32 level;
  4040. } GD_DSP_CMD_DIGITAL_GAIN_SATURATION_S;
  4041. typedef struct
  4042. {
  4043. // cmd_code: 0x0000f003 GD_CHROMA_MEDIAN_FILTER
  4044. U32 cmd_code;
  4045. U32 enable;
  4046. } GD_DSP_CMD_CHROMA_MEDIAN_FILTER_S;
  4047. typedef struct
  4048. {
  4049. // cmd_code: 0x0000f004 GD_LUMA_DIRECTIONAL_FILTER
  4050. U32 cmd_code;
  4051. U32 strength;
  4052. } GD_DSP_CMD_LUMA_DIRECTIONAL_FILTER_S;
  4053. typedef struct
  4054. {
  4055. // cmd_code: 0x0000f005 GD_LUMA_SHARPEN
  4056. U32 cmd_code;
  4057. U32 enable;
  4058. U32 lp_coef[6];
  4059. U32 alpha_max_pos;
  4060. U32 alpha_max_neg;
  4061. U32 thresh_gradient;
  4062. } GD_DSP_CMD_LUMA_SHARPEN_S;
  4063. typedef struct
  4064. {
  4065. // cmd_code: 0x0000f006 GD_MAIN_RESAMPLER_BANDWIDTH
  4066. U32 cmd_code;
  4067. U8 strength_luma;
  4068. U8 strength_chroma;
  4069. } GD_DSP_CMD_MAIN_RESAMPLER_S;
  4070. typedef struct
  4071. {
  4072. // cmd_code: 0x0000f007 GD_CFA_RESAMPLER_BANDWIDTH
  4073. U32 cmd_code;
  4074. U8 strength;
  4075. } GD_DSP_CMD_CFA_RESAMPLER_BANDWIDTH_S;
  4076. typedef struct
  4077. {
  4078. // cmd_code: 0x0000ff00 GD_DSP_DEBUG_0
  4079. // cmd_code: 0x0000ff01 GD_DSP_DEBUG_1
  4080. U32 cmd_code;
  4081. U32 dram_addr;
  4082. } GD_DSP_CMD_DSP_DEBUG_S;
  4083. typedef struct
  4084. {
  4085. // cmd_code: 0x0000ff02 GD_AAA_STATISTICS_DEBUG
  4086. U32 cmd_code;
  4087. U32 on : 8;
  4088. U32 reserved: 24;
  4089. U32 data_fifo_base;
  4090. U32 data_fifo_limit;
  4091. U16 ae_awb_tile_num_col;
  4092. U16 ae_awb_tile_num_row;
  4093. U16 ae_awb_tile_col_start;
  4094. U16 ae_awb_tile_row_start;
  4095. U16 ae_awb_tile_width;
  4096. U16 ae_awb_tile_height;
  4097. U32 ae_awb_pix_min_value;
  4098. U32 ae_awb_pix_max_value;
  4099. U16 ae_awb_tile_rgb_shift;
  4100. U16 ae_awb_tile_y_shift;
  4101. U16 ae_awb_tile_min_max_shift;
  4102. U16 af_tile_num_col;
  4103. U16 af_tile_num_row;
  4104. U16 af_tile_col_start;
  4105. U16 af_tile_row_start;
  4106. U16 af_tile_width;
  4107. U16 af_tile_height;
  4108. U16 af_tile_active_width;
  4109. U16 af_tile_active_height;
  4110. U16 af_tile_focus_value_shift;
  4111. U16 af_tile_y_shift;
  4112. U8 af_horizontal_filter1_mode;
  4113. U8 af_horizontal_filter1_stage1_enb;
  4114. U8 af_horizontal_filter1_stage2_enb;
  4115. U8 af_horizontal_filter1_stage3_enb;
  4116. U16 af_horizontal_filter1_gain[7];
  4117. U16 af_horizontal_filter1_shift[4];
  4118. U16 af_horizontal_filter1_bias_off;
  4119. U16 af_vertical_filter1_thresh;
  4120. U8 af_horizontal_filter2_mode;
  4121. U8 af_horizontal_filter2_stage1_enb;
  4122. U8 af_horizontal_filter2_stage2_enb;
  4123. U8 af_horizontal_filter2_stage3_enb;
  4124. U16 af_horizontal_filter2_gain[7];
  4125. U16 af_horizontal_filter2_shift[4];
  4126. U16 af_horizontal_filter2_bias_off;
  4127. U16 af_vertical_filter2_thresh;
  4128. U16 af_tile_fv1_horizontal_shift;
  4129. U16 af_tile_fv1_vertical_shift;
  4130. U16 af_tile_fv1_horizontal_weight;
  4131. U16 af_tile_fv1_vertical_weight;
  4132. U16 af_tile_fv2_horizontal_shift;
  4133. U16 af_tile_fv2_vertical_shift;
  4134. U16 af_tile_fv2_horizontal_weight;
  4135. U16 af_tile_fv2_vertical_weight;
  4136. } GD_DSP_CMD_AAA_STATISTICS_DEBUG_S;
  4137. typedef struct
  4138. {
  4139. // cmd_code: 0x0000ff03 GD_DSP_SPECIAL
  4140. U32 cmd_code;
  4141. U32 p0;
  4142. U32 p1;
  4143. U32 p2;
  4144. } GD_DSP_CMD_DSP_SPECIAL_S;
  4145. typedef struct
  4146. {
  4147. // cmd_code: 0x0000ff04 GD_AAA_STATISTICS_DEBUG1
  4148. // cmd_code: 0x0000ff05 GD_AAA_STATISTICS_DEBUG2
  4149. U32 cmd_code;
  4150. U32 on : 8;
  4151. U32 reserved: 24;
  4152. U32 data_fifo_base;
  4153. U32 data_fifo_limit;
  4154. U16 ae_awb_tile_num_col;
  4155. U16 ae_awb_tile_num_row;
  4156. U16 ae_awb_tile_col_start;
  4157. U16 ae_awb_tile_row_start;
  4158. U16 ae_awb_tile_width;
  4159. U16 ae_awb_tile_height;
  4160. U32 ae_awb_pix_min_value;
  4161. U32 ae_awb_pix_max_value;
  4162. U16 ae_awb_tile_rgb_shift;
  4163. U16 ae_awb_tile_y_shift;
  4164. U16 ae_awb_tile_min_max_shift;
  4165. U16 af_tile_num_col;
  4166. U16 af_tile_num_row;
  4167. U16 af_tile_col_start;
  4168. U16 af_tile_row_start;
  4169. U16 af_tile_width;
  4170. U16 af_tile_height;
  4171. U16 af_tile_active_width;
  4172. U16 af_tile_active_height;
  4173. U16 af_tile_focus_value_shift;
  4174. U16 af_tile_y_shift;
  4175. U8 af_horizontal_filter_mode;
  4176. U8 af_horizontal_filter_stage1_enb;
  4177. U8 af_horizontal_filter_stage2_enb;
  4178. U8 af_horizontal_filter_stage3_enb;
  4179. U16 af_horizontal_filter_gain[7];
  4180. U16 af_horizontal_filter_shift[4];
  4181. U16 af_horizontal_filter_bias_off;
  4182. U16 af_vertical_filter1_thresh;
  4183. U16 af_tile_fv_horizontal_shift;
  4184. U16 af_tile_fv_vertical_shift;
  4185. U16 af_tile_fv_horizontal_weight;
  4186. U16 af_tile_fv_vertical_weight;
  4187. } GD_DSP_CMD_AAA_STATISTICS_DEBUG12_S;
  4188. typedef struct
  4189. {
  4190. // cmd_code: 0x0000ff06 GD_BAD_PIXEL_CROP
  4191. U32 cmd_code;
  4192. U8 enable;
  4193. U16 offset_horiz;
  4194. U16 offset_vert;
  4195. } GD_DSP_CMD_BAD_PIXEL_CROP_S;
  4196. typedef struct
  4197. {
  4198. // cmd_code: 0x0000ff07 GD_DSP_DEBUG_2
  4199. U32 cmd_code;
  4200. U32 dram_addr;
  4201. U32 dram_size;
  4202. U32 mode;
  4203. } GD_DSP_CMD_DSP_DEBUG_2_S;
  4204. typedef struct
  4205. {
  4206. // cmd_code: 0x0000ff08 GD_DSP_DEBUG_3
  4207. U32 cmd_code;
  4208. U32 mode;
  4209. U32 param1;
  4210. U32 param2;
  4211. U32 param3;
  4212. U32 param4;
  4213. U32 param5;
  4214. U32 param6;
  4215. U32 param7;
  4216. U32 param8;
  4217. } GD_DSP_CMD_DSP_DEBUG_3_S;
  4218. typedef struct
  4219. {
  4220. // cmd_code: 0x0000ff09 GD_UPDATE_IDSP_CONFIG
  4221. U32 cmd_code;
  4222. U16 section_id;
  4223. U8 mode;
  4224. U8 table_sel;
  4225. U32 dram_addr;
  4226. U32 data_size;
  4227. } GD_DSP_CMD_UPDATE_IDSP_CONFIG_S;
  4228. typedef struct
  4229. {
  4230. // cmd_code: 0x0000ff0a GD_REAL_TIME_RATE_MODIFY
  4231. U32 cmd_code;
  4232. U32 real_time_rate_modify;
  4233. U32 chan_id;
  4234. } GD_DSP_CMD_REAL_TIME_RATE_MODIFY_S;
  4235. typedef struct
  4236. {
  4237. U32 cmd_code; //???
  4238. U32 real_time_cbr_modify;
  4239. U32 chan_id;
  4240. } GD_DSP_CMD_REAL_TIME_CBR_MODIFY_S;
  4241. typedef union
  4242. {
  4243. U32 cmddata[32];
  4244. GD_DSP_CMD_INTERRUPT_SETUP_S interrupt_setup;
  4245. GD_DSP_CMD_H264_ENCODE_SETUP_S h264_encode_setup;
  4246. GD_DSP_CMD_JPEG_ENCODE_SETUP_S jpeg_encode_setup;
  4247. GD_DSP_CMD_H264_DECODE_SETUP_S h264_decode_setup;
  4248. GD_DSP_CMD_JPEG_DECODE_SETUP_S jpeg_decode_setup;
  4249. GD_DSP_CMD_RESET_OPERATION_S reset_operation;
  4250. GD_DSP_CMD_VIDEO_OUTPUT_RESTART_S video_output_restart;
  4251. GD_DSP_CMD_VIN_TIMER_MODE_S vin_timer_mode;
  4252. GD_DSP_CMD_CHIP_SELECT_S chip_select;
  4253. GD_DSP_CMD_HD_ECHO_SETUP_S hd_echo_setup;
  4254. GD_DSP_CMD_SYSTEM_SETUP_INFO_S system_setup_info;
  4255. GD_DSP_CMD_EIS_SWITCHVOUT_DURING_ENCOD_S eis_switchvout_during_encod;
  4256. GD_DSP_CMD_DSP_DEBUG_LEVEL_SETUP_S dsp_debug_level_setup;
  4257. GD_DSP_CMD_SYSTEM_PARAMETERS_SETUP_S system_parameters_setup;
  4258. GD_DSP_CMD_SYSTEM_IDSP_FREQ_SETUP_S system_idsp_freq_setup;
  4259. GD_DSP_CMD_SENSOR_INPUT_SETUP_S sensor_input_setup;
  4260. GD_DSP_CMD_RGB_GAIN_ADJUST_S rgb_gain_adjust;
  4261. GD_DSP_CMD_VIGNETTE_COMPENSATION_S vignette_compensation;
  4262. GD_DSP_CMD_AAA_STATISTICS_SETUP_S aaa_statistics_setup;
  4263. GD_DSP_CMD_LUMA_SHARPEN_SETUP_S luma_sharpen_setup;
  4264. GD_DSP_CMD_RGB_TO_RGB_STUP_S rgb_to_rgb_stup;
  4265. GD_DSP_CMD_RGB_TO_YUV_STUP_S rgb_to_yuv_stup;
  4266. GD_DSP_CMD_GAMMA_CURVE_SETUP_S gamma_curve_setup;
  4267. GD_DSP_CMD_NOISE_FILTER_SETUP_S noise_filter_setup;
  4268. GD_DSP_CMD_BAD_PIXEL_CORRECT_SETUP_S bad_pixel_correct_setup;
  4269. GD_DSP_CMD_VID_FADE_IN_OUT_SETUP_S vid_fade_in_out_setup;
  4270. GD_DSP_CMD_CFA_DOMAIN_LEAKAGE_FILTER_S cfa_domain_leakage_filter;
  4271. GD_DSP_CMD_MCTF_MV_STAB_SETUP_S mctf_mv_stab_setup;
  4272. GD_DSP_CMD_SET_SLOW_SHUTTER_UPSAMPLING_RATE_S set_slow_shutter_upsampling_rate;
  4273. GD_DSP_CMD_SENSOR_CAP_REPEAT_S sensor_cap_repeat;
  4274. GD_DSP_CMD_MCTF_GMV_SETUP_S mctf_gmv_setup;
  4275. GD_DSP_CMD_DIS_ALGO_PARAMS_S dis_algo_params;
  4276. GD_DSP_CMD_VIN_CAP_WIN_S vin_cap_win;
  4277. GD_DSP_CMD_AMPLIFIER_LINEAR_S amplifier_linear;
  4278. GD_DSP_CMD_PIXEL_SHUFFLE_S pixel_shuffle;
  4279. GD_DSP_CMD_BLACK_LEVEL_CORRECTTION_S black_level_correcttion;
  4280. GD_DSP_CMD_BLACK_LEVEL_STATE_TABLE_S black_level_state_table;
  4281. GD_DSP_CMD_BLACK_LEVEL_DETECT_WIN_S black_level_detect_win;
  4282. GD_DSP_CMD_FIXED_PATTERN_NOISE_CORRECT_S fixed_pattern_noise_correct;
  4283. GD_DSP_CMD_CFA_NOISE_FILTER_INFO_S cfa_noise_filter_info;
  4284. GD_DSP_CMD_DIGITAL_GAIN_LEVEL_S digital_gain_level;
  4285. GD_DSP_CMD_LOCAL_EXPOSURE_S local_exposure;
  4286. GD_DSP_CMD_DEMOASIC_FILTER_S demoasic_filter;
  4287. GD_DSP_CMD_RGB_NOISE_FILTER_S rgb_noise_filter;
  4288. GD_DSP_CMD_COLOR_CORRECTION_S color_correction;
  4289. GD_DSP_CMD_CHROMA_MEDIAN_FILTER_INFO_S chroma_median_filter_info;
  4290. GD_DSP_CMD_CHROMA_SCALE_S chroma_scale;
  4291. GD_DSP_CMD_LUMA_SHARPENING_S luma_sharpening;
  4292. GD_DSP_CMD_AAA_STATISTICS_SETUP12_S aaat_satistics_setup12;
  4293. GD_DSP_CMD_AAA_PSEUDO_Y_S aaa_pseudo_y;
  4294. GD_DSP_CMD_AAA_HISTOGRAM_S aaa_histogram;
  4295. GD_DSP_CMD_RAW_COMPRESSION_S raw_compression;
  4296. GD_DSP_CMD_RAW_DECOMPRESSION_S raw_decompression;
  4297. GD_DSP_CMD_ROLLING_SHUTTER_COMPENSATION_S rolling_shutter_compensation;
  4298. GD_DSP_CMD_ZOOM_FACTOR_S zoom_factor;
  4299. GD_DSP_CMD_AAA_STATISTICS_SETUP3_S aaa_statistics_setup3;
  4300. GD_DSP_CMD_VIDEO_PREVIEW_S video_preview;
  4301. GD_DSP_CMD_ANTI_ALIASING_FILTER_S anti_aliasing_filter;
  4302. GD_DSP_CMD_FPN_CALIBRATION_S fpn_calibration;
  4303. GD_DSP_CMD_BLACK_LEVEL_GLOBAL_OFFSET_S black_level_global_offset;
  4304. GD_DSP_CMD_RGB_DIRECTIONAL_FILTER_S rgb_directional_filter;
  4305. GD_DSP_CMD_HDR_MIXER_S hdr_mixer;
  4306. GD_DSP_CMD_LUMA_SHARPENING_LINEARIZATION_S luma_sharpening_linearization;
  4307. GD_DSP_CMD_LUMA_SHARPENING_FIR_CONFIG_S luma_sharpening_fir_config;
  4308. GD_DSP_CMD_LUMA_SHARPENING_LNL_S luma_sharpening_lnl;
  4309. GD_DSP_CMD_LUMA_SHARPENING_TONE_CONTROL_S luma_sharpening_tone_control;
  4310. GD_DSP_CMD_MULTI_STREAM_PREVIEW_S multi_stream_preview;
  4311. GD_DSP_CMD_ENA_SECOND_STREAM_S ena_second_stream;
  4312. GD_DSP_CMD_SET_ALPHA_CHANNEL_S set_alpha_channel;
  4313. GD_DSP_CMD_MODIFY_FRAME_BUFFER_S modify_frame_buffer;
  4314. GD_DSP_CMD_SET_ATIVE_WIN_CTR_OFS_S set_ative_win_ctr_ofs;
  4315. GD_DSP_CMD_SET_WARP_CONTROL_S set_warp_control;
  4316. GD_DSP_CMD_EARLY_WB_GAIN_S early_wb_gain;
  4317. GD_DSP_CMD_LUMA_SHARPENING_EDGE_CONTROL_S luma_sharpening_edge_control;
  4318. GD_DSP_CMD_LUMA_SHARPENING_BLEND_CONTROL_S luma_sharpening_blend_control;
  4319. GD_DSP_CMD_LUMA_SHARPENING_LEVEL_CONTROL_S luma_sharpening_level_control;
  4320. GD_DSP_CMD_LUMA_SHARPENING_MISC_CONTROL_S luma_sharpening_misc_control;
  4321. GD_DSP_CMD_AAA_EARLY_WB_GAIN_S aaa_early_wb_gain;
  4322. GD_DSP_CMD_VIDEO_PREPROC_S video_preproc;
  4323. GD_DSP_CMD_FAST_AAA_CAPTURE_S fast_aaa_capture;
  4324. GD_DSP_CMD_H264_ENCODE_S h264_encode;
  4325. GD_DSP_CMD_H264_ENCODE_FROM_MEMORY_PARAM_S h264_encode_from_memory_param;
  4326. GD_DSP_CMD_H264_ENCODE_BITS_FIFO_UPDATE_S h264_encode_bits_fifo_update;
  4327. GD_DSP_CMD_H264_ENCODE_STOP_S h264_encode_stop;
  4328. GD_DSP_CMD_PROC_DELAY_S proc_delay;
  4329. GD_DSP_CMD_STILL_CAPTURE_S still_capture;
  4330. GD_DSP_CMD_STILL_PROC_FROM_MEMORY_S still_proc_from_memory;
  4331. GD_DSP_CMD_JPEG_BITS_FIFO_UPDATE_S jpeg_bits_fifo_update;
  4332. GD_DSP_CMD_FREE_RAW_YUV_PICTURE_BUFFER_S free_raw_yuv_picture_buffer;
  4333. GD_DSP_CMD_JPEG_STOP_S jpeg_stop;
  4334. GD_DSP_CMD_MJPEG_CAPTURE_S mjpeg_capture;
  4335. GD_DSP_CMD_VID_FADE_IN_OUT_S vid_fade_in_out;
  4336. GD_DSP_CMD_MJPEG_CAPTURE_WITH_264_S mjpeg_capture_with_264;
  4337. GD_DSP_CMD_OSD_INSERT_S osd_insert;
  4338. GD_DSP_CMD_YUV422_CAPTURE_S yuv422_capture;
  4339. GD_DSP_CMD_CAVLC_RESULT_S cavlc_result;
  4340. GD_DSP_CMD_STILL_CAP_IN_REC_S still_cap_in_rec;
  4341. GD_DSP_CMD_OSD_BLEND_S osd_blend;
  4342. GD_DSP_CMD_INTERVAL_CAP_S interval_cap;
  4343. GD_DSP_CMD_STILL_CAPTURE_ADV_S still_capture_adv;
  4344. GD_DSP_CMD_H264_DECODE_S h264_decode;
  4345. GD_DSP_CMD_JPEG_DECODE_S jpeg_decode;
  4346. GD_DSP_CMD_RAW_PIC_DECODE_S raw_pic_decode;
  4347. GD_DSP_CMD_RESCALE_POSTPROC_S rescale_postproc;
  4348. GD_DSP_CMD_H264_DECODE_BITS_FIFO_UPDATE_S h264_decode_bits_fifo_update;
  4349. GD_DSP_CMD_H264_PLAYBACK_SPEED_S h264_playback_speed;
  4350. GD_DSP_CMD_H264_TRICKPLAY_S h264_trickplay;
  4351. GD_DSP_CMD_H264_DECODE_STOP_S h264_decode_stop;
  4352. GD_DSP_CMD_MULTI_SCENE_DECODE_S multi_scene_decode;
  4353. GD_DSP_CMD_CAPTURE_VIDEO_PIC_S capture_video_pic;
  4354. GD_DSP_CMD_CAPTURE_STILL_PIC_S capture_still_pic;
  4355. GD_DSP_CMD_JPEG_FREEZE_S jpeg_freeze;
  4356. GD_DSP_CMD_MULTI_SCENE_SETUP_S multi_scene_setup;
  4357. GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_S multi_scene_decode_adv;
  4358. GD_DSP_CMD_JPEG_DECODE_THUMBNAIL_WARP_S jpeg_decode_thumbnail_warp;
  4359. GD_DSP_CMD_MULTI_SCENE_DECODE_ADV_2_S multi_scene_decode_adv_2;
  4360. GD_DSP_CMD_IPCAM_VIDEO_PREPROC_S ipcam_video_preproc;
  4361. GD_DSP_CMD_IPCAM_CAPTURE_PREVIEW_SIZE_SETUP_S ipcam_capture_preview_size_setup;
  4362. GD_DSP_CMD_IPCAM_VIDEO_ENCODE_SIZE_SETUP_S ipcam_video_encode_size_setup;
  4363. GD_DSP_CMD_IPCAM_REAL_TIME_ENCODE_PARAM_SETUP_S ipcam_real_time_encode_param_setup;
  4364. GD_DSP_CMD_FORCE_IDR_S force_idr;
  4365. GD_DSP_CMD_IPCAM_VIDEO_SYSTEM_SETUP_S ipcam_video_system_setup;
  4366. GD_DSP_CMD_IPCAM_OSD_INSERT_S ipcam_osd_insert;
  4367. GD_DSP_CMD_IPCAM_SET_PRIVACY_MASK_S ipcam_set_privacy_mask;
  4368. GD_DSP_CMD_IPCAM_QP_RATIO_S ipcam_qp_ratio;
  4369. GD_DSP_CMD_VOUT_MIXER_SETUP_S vout_mixer_setup;
  4370. GD_DSP_CMD_VOUT_VIDEO_SETUP_S vout_video_setup;
  4371. GD_DSP_CMD_VOUT_DEFAULT_IMG_SETUP_S vout_default_img_setup;
  4372. GD_DSP_CMD_VOUT_OSD_SETUP_S vout_osd_setup;
  4373. GD_DSP_CMD_VOUT_OSD_BUF_SETUP_S vout_osd_buf_setup;
  4374. GD_DSP_CMD_VOUT_OSD_CLUT_SETUP_S vout_osd_clut_setup;
  4375. GD_DSP_CMD_VOUT_DISPLAY_SETUP_S vout_display_setup;
  4376. GD_DSP_CMD_VOUT_DVE_SETUP_S vout_dve_setup;
  4377. GD_DSP_CMD_VOUT_RESET_S vout_reset;
  4378. GD_DSP_CMD_VOUT_DISPLAY_CSC_SETUP_S vout_display_csc_setup;
  4379. GD_DSP_CMD_VOUT_DIGITAL_OUTPUT_MODE_SETUP_S vout_digital_output_mode_setup;
  4380. GD_DSP_CMD_CFA_NOISE_FILTER_S cfa_noise_filter;
  4381. GD_DSP_CMD_DIGITAL_GAIN_SATURATION_S digital_gain_saturation;
  4382. GD_DSP_CMD_CHROMA_MEDIAN_FILTER_S chroma_median_filter;
  4383. GD_DSP_CMD_LUMA_DIRECTIONAL_FILTER_S luma_directional_filter;
  4384. GD_DSP_CMD_LUMA_SHARPEN_S luma_sharpen;
  4385. GD_DSP_CMD_MAIN_RESAMPLER_S main_resampler;
  4386. GD_DSP_CMD_CFA_RESAMPLER_BANDWIDTH_S cfa_resampler_bandwidth;
  4387. GD_DSP_CMD_DSP_DEBUG_S dsp_debug;
  4388. GD_DSP_CMD_AAA_STATISTICS_DEBUG_S aaa_statistics_debug;
  4389. GD_DSP_CMD_DSP_SPECIAL_S dsp_special;
  4390. GD_DSP_CMD_AAA_STATISTICS_DEBUG12_S aaa_statistics_debug12;
  4391. GD_DSP_CMD_BAD_PIXEL_CROP_S bad_pixel_crop;
  4392. GD_DSP_CMD_DSP_DEBUG_2_S dsp_debug_2;
  4393. GD_DSP_CMD_DSP_DEBUG_3_S dsp_debug_3;
  4394. GD_DSP_CMD_UPDATE_IDSP_CONFIG_S update_idsp_config;
  4395. GD_DSP_CMD_REAL_TIME_RATE_MODIFY_S real_time_rate_modify;
  4396. GD_DSP_CMD_REAL_TIME_CBR_MODIFY_S real_time_cbr_modify;
  4397. }GD_DSP_CMD_S;
  4398. //*****************************************************************************
  4399. //*****************************************************************************
  4400. //** Global Data
  4401. //*****************************************************************************
  4402. //*****************************************************************************
  4403. //*****************************************************************************
  4404. //*****************************************************************************
  4405. //** API Functions
  4406. //*****************************************************************************
  4407. //*****************************************************************************
  4408. U32 GD_DSP_CMD_GET_CODE_CR_PC_T0_ADDR(void);
  4409. #ifdef __cplusplus
  4410. extern "C" {
  4411. #endif
  4412. #ifdef __cplusplus
  4413. }
  4414. #endif
  4415. #endif /* _GD_IDSP_CMD_H_ */